# \[RAILS\]Using Gems through proxy with authentication

**URL:** <https://www.ruby-forum.com/t/rails-using-gems-through-proxy-with-authentication/121759>\
**Category:** Rails\
**Created:** [November 30, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/rails-using-gems-through-proxy-with-authentication/121759 "2007-11-30T17:03:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirtytree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@dirtytree](https://www.ruby-forum.com/u/dirtytree)\
**Post date:** [November 30, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/rails-using-gems-through-proxy-with-authentication/121759/1 "2007-11-30T17:03:09Z")

</div>

I am trying to use rubygems to install rails but I am behind a proxy  
that requires authentication.

I am trying to use the following:

gem install rails --include-dependencies -p (I have HTTP\_PROXY set  
to ‘[http://myurl:8080](http://myurl:8080)’

I get the following error

ERROR: While executing gem … (Gem::RemoteSource Exception)  
HTTP Response 407

I need to authenticate on the proxy server with a username/pass but  
cannot find any documentation showing how to pass this to the proxy.

Any ideas?

Dave

–  
Dave T.  
[http://dathompson.blogspot.com](http://dathompson.blogspot.com)

---

<div class="post-metadata">

**Author:** ![dirtytree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@dirtytree](https://www.ruby-forum.com/u/dirtytree)\
**Post date:** [November 30, 2007, 10:05pm UTC](https://www.ruby-forum.com/t/rails-using-gems-through-proxy-with-authentication/121759/2 "2007-11-30T22:05:07Z")

</div>

Try this: HTTP\_PROXY=‘[http://user](http://user):pass@proxy\_url:port’

klodus

Dave T. wrote:

> I am trying to use rubygems to install rails but I am behind a proxy  
> that requires authentication.
> 
> I am trying to use the following:
> 
> gem install rails --include-dependencies -p (I have HTTP\_PROXY set  
> to ‘[http://myurl:8080](http://myurl:8080)’
> 
> I get the following error
> 
> ERROR: While executing gem … (Gem::RemoteSource Exception)  
> HTTP Response 407
> 
> I need to authenticate on the proxy server with a username/pass but  
> cannot find any documentation showing how to pass this to the proxy.
> 
> Any ideas?
> 
> Dave
> 
> –  
> Dave T.  
> [http://dathompson.blogspot.com](http://dathompson.blogspot.com)
