# RubyGem Not Respecting Proxy Argument?

**URL:** <https://www.ruby-forum.com/t/rubygem-not-respecting-proxy-argument/65979>\
**Category:** Ruby\
**Created:** [August 22, 2006, 7:04pm UTC](https://www.ruby-forum.com/t/rubygem-not-respecting-proxy-argument/65979 "2006-08-22T19:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@Nicholas\_E](https://www.ruby-forum.com/u/Nicholas_E)\
**Post date:** [August 22, 2006, 7:04pm UTC](https://www.ruby-forum.com/t/rubygem-not-respecting-proxy-argument/65979/1 "2006-08-22T19:04:53Z")

</div>

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://: 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.

---

<div class="post-metadata">

**Author:** ![Nicholas\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/da6949/32.png) [@Nicholas\_E](https://www.ruby-forum.com/u/Nicholas_E)\
**Post date:** [August 22, 2006, 7:43pm UTC](https://www.ruby-forum.com/t/rubygem-not-respecting-proxy-argument/65979/2 "2006-08-22T19:43:27Z")

</div>

Nicholas E. 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 W.
