Trouble using rubygems config file on windows

R

rpardee

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
 
R

rpardee

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,219
Messages
2,571,122
Members
47,743
Latest member
henrywalker

Latest Threads

Top