2
votes

For some reason, I can't add new gems (which haven't been donwloaded/used before) to my system. When I run bundle install after adding them to the Gemfile, I get errors like this:

/usr/lib/ruby/1.8/rubygems/remote_fetcher.rb:180:in `fetch_path': SocketError: getaddrinfo: Name or service not known (http://rubygems.org/quick/Marshal.4.8/google_places_autocomplete-0.0.2.gemspec.rz) (Gem::RemoteFetcher::FetchError) from /usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:106:in `fetch_spec'
from /var/lib/gems/1.8/gems/bundler-1.0.14/lib/bundler/remote_specification.rb:47:in `_remote_specification'
from /var/lib/gems/1.8/gems/bundler-1.0.14/lib/bundler/remote_specification.rb:53:in `method_missing'
from /var/lib/gems/1.8/gems/bundler-1.0.14/lib/bundler/resolver.rb:101:in `__dependencies'
from /var/lib/gems/1.8/gems/bundler-1.0.14/lib/bundler/resolver.rb:98:in `each'
from /var/lib/gems/1.8/gems/bundler-1.0.14/lib/bundler/resolver.rb:98:in `__dependencies'
....
from /var/lib/gems/1.8/bin/bundle:19

This just happened out of the blue. All the gems I'm trying are from the official rubygems.org website. It's always the same exact error (just with the gem name changed in the URL on the first line). If I run bundle install without adding any new gems, it works fine.

Does anyone have any insight on how to fix this?

3
Can you post before and after Gemfile?user482594
@user482594 gem 'sqlite3-ruby', '1.3.3', :require => 'sqlite3' gem 'devise' gem 'rspec-rails', '2.6.1' gem 'google_places' #gem 'google_places_autocomplete' This is the before gemfile. In the after, I simply uncomment the last line.Ankit Soni
This looks like a network error. Are you sure rubygems.org is reachable from your location?eugen
Has this same error. Looks like re-fetching fixed it.Peter Ehrlich

3 Answers

2
votes

@eugen Thank you. Yes rubygems.org was reachable, but my DNS servers were configured incorrectly. I added an openDNS server (8.8.8.8) to my DNS servers in my network preferences, now it works fine.

1
votes

I ran into this error and removed my Gemfile.lock. This fixed it. It might not be acceptable for everyone, but it worked in my situation.

0
votes

Has this same error. Looks like re-fetching fixed it.