[BUG] RubyGem Not Respecting Proxy Argument?

Howdy list,

I believe that I stumbled across a bug in RubyGems. I apologize if this is
the wrong place to send such a report, but I could find nowhere else.

So, I am required to go through a proxy server for outbound port 80 traffic.
Any outbound traffic on 80 that isn't to the proxy server does not go
anywhere at all, including attempts to install gems.

No big deal, right? Gem supports HTTP proxies, and I think you are supposed
to specify like this:

computer:~ nevans$ sudo gem install --remote --http-proxy
http://<snip>:<snip> rmail

However, this would not work. I would get the following error:

ERROR: While executing gem ... (Errno::ECONNREFUSED)
    Connection refused - connect(2)

Whenever I set the environment variable http_proxy, it would install
packages without giving me this error.

I came up with changing the call to @fetcher_class.new in the download_gem
method in remote_install.rb:

      rsf = @fetcher_class.new(source, @options[:http_proxy]) # @proxy_uri)

It was using @proxy_uri, which I determined was not being set. I'm not sure
if this is the most correct fix, but it seems to be working for me now.

I am using RubyGem version 0.9.0 and Ruby 1.8.4 on OS X 10.4.7.

···

--
Nicholas Evans

Nicholas Evans wrote:

I believe that I stumbled across a bug in RubyGems. I apologize if this
is the wrong place to send such a report, but I could find nowhere else.

The best place to put this is on the RubyGems dev mailing list,
available thru RubyForge. I don't monitor RubyTalk as closely I as used
to, so questions here might get missed.

[... proxy problem described ...]

I came up with changing the call to @fetcher_class.new in the
download_gem
method in remote_install.rb:

      rsf = @fetcher_class.new(source, @options[:http_proxy]) #
@proxy_uri)

It was using @proxy_uri, which I determined was not being set. I'm not
sure
if this is the most correct fix, but it seems to be working for me now.

Looks like the right thing to do. I've commited this patch to the
RubyGems SVN head.

Thanks.

-- Jim Weirich

···

--
Posted via http://www.ruby-forum.com/\.