Death, taxes, forgetting how to fix that annoying issue you always run in to when starting a new project. They are inevitable. I rank this one up there with failed to build gem native extension on a new system.
If you’re trying to install a new Ruby gem and it hangs (with no feedback as to what is going on), nine times out of ten you have a gem source server that isn’t responding. Check your source list:
1 2 3 4 5 |
gem source *** CURRENT SOURCES *** http://rubygems.org/ http://aserveryoucantreach.gems.org/ |
Edit your ~/.gemrc
and get rid of any troublesome sources and try again.
1 2 3 |
$ gem install cocoapods ... 14 gems installed |
Moreover, if you ever find yourself in this situation again (which you will!) you can get a clue as to what is going on with gem install
by using the --verbose
option:
1 2 3 4 5 6 7 8 |
$ gem install cocoapods --verbose HEAD http://rubygems.org/latest_specs.4.8.gz 302 Moved Temporarily HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz 200 OK ... Successfully installed cocoapods-0.34.4 1 gem installed |
You’ll notice right away if gem install
hangs, and which source server is giving you trouble.