Skip to content

Instantly share code, notes, and snippets.

@delano
Created February 26, 2011 21:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save delano/845643 to your computer and use it in GitHub Desktop.
Save delano/845643 to your computer and use it in GitHub Desktop.
Fix for "Errno::ETIMEDOUT: Operation timed out - connect(2)" when installing gems
# A DNS change to Rubygems.org is causing lingering issues. Namely,
# rubygems.org and production.s3.rubygems.org are still pointing to
# the old address. See:
# http://twitter.com/#!/gemcutter/status/30666857698557952
# The symptoms:
# $ gem install benelux --version 0.5.17
# ERROR: Could not find a valid gem 'benelux' (= 0.5.17) in any repository
# ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
# Errno::ETIMEDOUT: Operation timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
# The fix:
# gem source -r http://rubygems.org/
# gem source -r http://production.s3.rubygems.org/
# gem source -a http://production.s3.rubygems.org.s3.amazonaws.com/
@elgalu
Copy link

elgalu commented Dec 5, 2013

If you were having this issue on TravisCI like i did you may solve it by using Travis hidden feature travis_retry
See an example usage here:
https://github.com/elgalu/crafting_rails4_apps/blob/ecc0eed/.travis.yml#L13-L14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment