Trouble using rubygems config file on windows

Hey All,

I'm trying to get rubygems to use my .gemrc file on windows and having
trouble--dig it:

C:\ruby\bin>gem environment
Failed to load C:\Documents and Settings\pardre1/.gemrc
Rubygems Environment:
  - VERSION: 0.9.0 (0.9.0)
  - INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8
  - GEM PATH:
     - C:/ruby/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

The file listed does indeed exist--I'm guessing there needs to be a
.gsub(/\\/, "/") in there somewhere to translate the backslashes to
forwardslashes on windows?

Thanks!

-Roy

rpardee@gmail.com wrote:

Hey All,

I'm trying to get rubygems to use my .gemrc file on windows and having
trouble--dig it:

C:\ruby\bin>gem environment
Failed to load C:\Documents and Settings\pardre1/.gemrc

See this line? Try changing the forward slash at the right to a
reverse-slash.

/ ...

The file listed does indeed exist--I'm guessing there needs to be a
.gsub(/\\/, "/") in there somewhere to translate the backslashes to
forwardslashes on windows?

Hard to say. But be consistent -- all forward, or all backward, but not
mixed as they are now.

···

--
Paul Lutus
http://www.arachnoid.com

Sure--I get that they all have to be forward slashes. But it's
rubygems--not code I've written, so I'm not sure exactly where to make
the change.

That said--I did try changing line 380 of
C:\ruby\lib\ruby\site_ruby\1.8\rubygems.rb to:

  return ENV[homekey].gsub(/\\/, "/") if ENV[homekey]

And now I get the same error message, except that the filespec looks
righteous:

C:\ruby\bin>gem environment
Failed to load C:/Documents and Settings/pardre1/.gemrc
Rubygems Environment:
  - VERSION: 0.9.0 (0.9.0)
  - INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8
  - GEM PATH:
     - C:/ruby/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

In irb, I can do e.g.,:

irb(main):001:0> f = File.open("C:/Documents and
Settings/pardre1/.gemrc")
=> #<File:C:/Documents and Settings/pardre1/.gemrc>
irb(main):002:0> f.read
=> "--http-proxy http://localhost:5865"
irb(main):003:0>

So maybe the problem is that my file is not interpretable as YAML? If
so--can anybody tell me how to say "use the proxy server
http://localhost:5865" in YAML?

Thanks!

-Roy

Paul Lutus wrote:

···

rpardee@gmail.com wrote:

> Hey All,
>
> I'm trying to get rubygems to use my .gemrc file on windows and having
> trouble--dig it:
>
> C:\ruby\bin>gem environment
> Failed to load C:\Documents and Settings\pardre1/.gemrc

See this line? Try changing the forward slash at the right to a
reverse-slash.

/ ...

> The file listed does indeed exist--I'm guessing there needs to be a
> .gsub(/\\/, "/") in there somewhere to translate the backslashes to
> forwardslashes on windows?

Hard to say. But be consistent -- all forward, or all backward, but not
mixed as they are now.

--
Paul Lutus
http://www.arachnoid.com