Skip to content

Instantly share code, notes, and snippets.

@mozmorris
Created February 2, 2013 10:19
Show Gist options
  • Save mozmorris/4696824 to your computer and use it in GitHub Desktop.
Save mozmorris/4696824 to your computer and use it in GitHub Desktop.
Fix RubyGems on CentOS after installation with Vagrant & Chef

Depending on the box used for the VM, the version of RubyGems might need updating. On the first attempt trying to install the Sinatra gem, I received the following message:

WARNING: RubyGems 1.2+ index not found for: http://rubygems.org/

Well 1.2 is out of date, let's fix that:

$ sudo gem update --system

On the second attempt, I got this error:

Error fetching data: SocketError: getaddrinfo: Name or service not known (http://rubygems.org/latest_specs.4.8.gz)

A connection to the internet wasn't the problem. Turns out the Chef recipes used a proxy with gem install and the system remembers the previous setting next time it's run. Let's explicitly tell gem not to use a proxy.

$ sudo gem install --no-http-proxy sinatra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment