rubygems doesn't catch NO_PROXY for certain hosts, and rubygems fails when one remote source is unavailable

Nick's Avatar

Nick

25 Apr, 2011 02:54 AM

I have a couple problems that cropped up and I'm not sure if they are Rubygems problems or not.

I have the latest Rubygems version on 1.9.2 (1.7.2) and I have been trying to get geminabox working locally. In my tests on running it at http://localhost:9292, rubygems seems to not recognize my NO_PROXY environment variable that has localhost included in it.(http://docs.rubygems.org/read/chapter/13#page51). Additionally, even if I specify --no-http-proxy, it still tries to connect through the proxy, where I get HTTP 502 errors from my proxy server.

Leading to the second issue, I added my localhost server to the REMOTE SOURCES listing, and now that the server isn't running, I can't download any gems at all. It seems that Rubygems just halts when it can't find the specs.gz file for one of my remote sources, even though rubygems.org isn't down:

PS C:\mydocs> gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.7.2
  - RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby192/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
    - C:/Ruby192/lib/ruby/gems/1.9.1
    - C:/mydocs/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
    - :update_sources => true
    - :verbose => true
    - :benchmark => false
    - :backtrace => false
    - :bulk_threshold => 1000
    - :sources => ["http://rubygems.org/", "http://localhost:9292/"]
    - "maven" => {"plugin_version"=>"0.25.1"}
    - "gem" => "--no-ri --no-rdoc"
    - "install" => "--no-rdoc --no-ri --env-shebang"
    - "update" => "--no-rdoc --no-ri --env-shebang"
  - REMOTE SOURCES:
    - http://rubygems.org/
    - http://localhost:9292/
PS C:\mydocs> gem install pry
ERROR:  Could not find a valid gem 'pry' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Bad Gateway 502 (http://localhost:9292/latest_specs.4.8.gz)
  1. Support Staff 1 Posted by Nick Quaranto on 27 May, 2011 12:32 AM

    Nick Quaranto's Avatar

    Any luck with this? I haven't heard or seen other reports...and we don't have many windows users besides that. Can you curl it? Download gems manually from it?

  2. 2 Posted by Nick on 27 May, 2011 03:07 AM

    Nick's Avatar

    Unfortunately, I haven't had much time to work on getting a gem server set up since that time.

    However, I can say that if I modify the .gemrc to include what would be a localhost server, all gem commands fail to work, even if the other locations are good.

    For instance, if I have a gem server set up at http://localhost:8080, and let's assume it's not running:

    PS C:\mydocs> gem env
    RubyGems Environment:
      - RUBYGEMS VERSION: 1.7.2
      - RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32]
      - INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
      - RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
      - EXECUTABLE DIRECTORY: C:/Ruby192/bin
      - RUBYGEMS PLATFORMS:
        - ruby
        - x86-mingw32
      - GEM PATHS:
        - C:/Ruby192/lib/ruby/gems/1.9.1
        - C:/mydocs/.gem/ruby/1.9.1
      - GEM CONFIGURATION:
        - :update_sources => true
        - :verbose => true
        - :benchmark => false
        - :backtrace => false
        - :bulk_threshold => 1000
        - :sources => ["http://rubygems.org/", "http://rubygems.torquebox.org/", "http://localhost:8080/"]
        - "install" => "--no-rdoc --no-ri --env-shebang"
        - "update" => "--no-rdoc --no-ri --env-shebang"
        - "maven" => {"plugin_version"=>"0.25.1"}
        - "gem" => "--no-ri --no-rdoc"
      - REMOTE SOURCES:
        - http://rubygems.org/
        - http://rubygems.torquebox.org/
        - http://localhost:8080/
    PS C:\mydocs> gem update --system
    ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
        bad response Bad Gateway 502 (http://localhost:8080/latest_specs.4.8.gz)
    

    no command will work, since it seems to just flop out once it gets a 502 from my non-existent localhost server. The reason I bring this up is that while rubygems.org is a reliable server (thank goodness), I have a somewhat less-than-reliable server for Torquebox(http://www.torquebox.org), and my own localhost server set up as well. Since either one of those could be down, I essentially have to remove those from the remote sources before I can do anything at all via bundler or rubygems.

  3. Support Staff 3 Posted by Luis Lavena on 19 Jun, 2011 04:13 PM

    Luis Lavena's Avatar

    Hello,

    I believe that the no host failure has been reported to RubyGems itself already:

    https://github.com/rubygems/rubygems/pull/105

    Bugs on RubyGems itself should be addressed in that particular tracker.

    Feel free to close this out if I'm correct.

  4. Nick closed this discussion on 19 Jun, 2011 04:47 PM.

  5. Nick re-opened this discussion on 19 Jun, 2011 04:48 PM

  6. 4 Posted by Nick on 19 Jun, 2011 04:48 PM

    Nick's Avatar

    Sounds like pull #105 is addressing this specific issue. Will close this. Thanks.

  7. Support Staff 5 Posted by Luis Lavena on 22 Jun, 2011 08:39 PM

    Luis Lavena's Avatar

    Oops, seems your reply reopened this. Closing this now.

    Thank you!

  8. Luis Lavena closed this discussion on 22 Jun, 2011 08:39 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

28 Oct, 2014 09:51 AM
23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM
18 Oct, 2014 08:39 PM
16 Oct, 2014 12:41 PM