Problems setting up Proxy for rubygems

Guillermo Estrada's Avatar

Guillermo Estrada

04 Aug, 2011 03:33 PM

Hi, I'm trying to run the gem install command and I'm getting the Forbidden error.

GET http://rubygems.org/latest_specs.4.8.gz
403 Forbidden

I know I have to check my proxy settings and so, but really, I've been a month trying different settings and still can't connect to install gems. I'm desperate. My proxy settings are through a *.pac file on Windows and I'm using Zscaler, if you need the content of the file is attached here. RubyGems do not accept me IP as parameter for proxy, but well, I have tried anything I could think of and still can't download gems. Please help!! And do not refer me to RubyGems Proxy documentation I know it by heart. (http://docs.rubygems.org/read/chapter/10)

Thanx for your help, it is GREATLY appreciated.

  1. Support Staff 1 Posted by Luis Lavena on 04 Aug, 2011 04:21 PM

    Luis Lavena's Avatar

    Hello,

    What are the settings on your web browser? Do you have an HTTP proxy?

    Don't understand the .pac file, but seems that depending on the URL you enter it uses different proxy.

    Please use --http-proxy option of gem install, like this:

    gem install rails --http-proxy=http://208.100.40.34:80/

    Or something like that, see the lines in your pac file:

    Or you can also use HTTP_PROXY environment variable.

    Please check with your proxy provider (or IT department in your company) to other ways of using command line applications with the proxy.

  2. 2 Posted by Guillermo Estra... on 04 Aug, 2011 04:48 PM

    Guillermo Estrada's Avatar

    Thats the issue, there are no settings on the Web Browser, Windows uses an option to automatically configure proxy connection through a script (the *.pac file) and thats it.

    Lets say for a random gem (s3)

    C:\> gem install s3 --verbose --http-proxy=http://208.100.40.34:80/ GET http://rubygems.org/latest_specs.4.8.gz 403 Forbidden GET http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz connection reset after 2 requests, retrying GET http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz 403 Forbidden Error fetching remote data: bad response Forbidden 403 (http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz) Falling back to local-only install ERROR: Could not find a valid gem 's3' (>= 0) in any repository ERROR: Possible alternatives: s3

    Now, I dunno why Rubygems can't download the file or its forbidden (403) because I can perfectly fine open my browser and download the specs files, or even curl them or wget them. So I can't figure out what to do to Rubygems, thanx for tour help.

  3. 3 Posted by Guillermo Estra... on 04 Aug, 2011 04:57 PM

    Guillermo Estrada's Avatar

    Oh another thing, this is what happens when I do NOT setup anything on the proxy env var or command line:

    C:\>gem install s3 --verbose Error fetching remote data: Errno::ENETUNREACH: Se ha intentado una operación de socket en una red no accesible. - connect(2) (http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz) Falling back to local-only install ERROR: Could not find a valid gem 's3' (>= 0) in any repository ERROR: Possible alternatives: s3

    Thats why when I configured the proxy and got a 403 I thought it was progress, but can't go past that. Another thing is the proxies: http://gateway.zscaler.net:80 and http://secondary.gateway.zscaler.net:80 seem to work, and both correspond to similar IP's found in the PAC file, but I'm still getting the 403.

  4. 4 Posted by Guillermo Estra... on 04 Aug, 2011 05:01 PM

    Guillermo Estrada's Avatar

    Using the proxy config I get 403 on the spec files, but if I open my browser, or wget, or even curl to the address of the spec files I can easily download them without any issues.

    Example with random gem:

    C:\Users\highurz1>gem install s3 --verbose -p http://secondary.gateway.zscaler.net:80 GET http://rubygems.org/latest_specs.4.8.gz 403 Forbidden GET http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz connection reset after 2 requests, retrying GET http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz 403 Forbidden Error fetching remote data: bad response Forbidden 403 (http://rubygems.org/quick/Marshal.4.8/s3-0.3.8.gemspec.rz) Falling back to local-only install ERROR: Could not find a valid gem 's3' (>= 0) in any repository ERROR: Possible alternatives: s3

  5. Support Staff 5 Posted by Luis Lavena on 04 Aug, 2011 05:26 PM

    Luis Lavena's Avatar

    Can't help you further on this. Seems you're missing username and password which could lead to the forbidden issue you're seeing.

    Please check your proxy documentation or the support sites of it.

    If your proxy doesn't cooperate with simple HTTP Proxy functionality, there is nothing I can do to help.

  6. Luis Lavena closed this discussion on 23 Sep, 2011 03:04 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

30 Oct, 2014 04:34 PM
30 Oct, 2014 02:46 PM
28 Oct, 2014 09:51 AM
23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM