Rubygems: Installing downloaded gems

I set aside some time this evening to move one of my projects forward. Just as I was getting into it I realised I needed to install some gems. The normally quick “sudo gem install blah” took forever.  After several frustrating minutes, rubygems coughed up the following error:

WARNING:  RubyGems 1.2+ index not found for:
http://gemcutter.org
http://gems.rubyforge.org/

RubyGems will revert to legacy indexes degrading performance.

Degrading performance it certainly was. Both aggravated and curious, I embarked on a flurry of pings, nslookups and GET requests which seem to indicate that Rubygems.org is, in fact, down. Interestingly, Heroku, which hosts rubygems.org was up, reachable and blazing fast. Not wanting to totally waste an evening I figured now was a pretty good time to look into installing gems manually. Luckily it was really easy, but rubygems generally makes it so you don’t need to consider any other options.

The gem I was after offered two options: download as a tar file or a gem file.

Installing from the tar file seems to be a matter of extracting it into /usr/lib/ruby/gems/1.8/gems/ and a quick look at the README file indicated I needed to run setup.rb. That might not hold for all gems but it worked for that one.

Just out of interest I also tried installing from the downloaded gem file. It turns out that its even easier. After downloading the gem file all it took was:

mike@sleepycat:~$ cd Downloads/
mike@sleepycat:~/Downloads$ sudo gem install ruby-openid-2.1.8.gem
Successfully installed ruby-openid-2.1.8
1 gem installed
Installing ri documentation for ruby-openid-2.1.8…
Installing RDoc documentation for ruby-openid-2.1.8…

Not difficult, but not something I had had to do before. Hopefully Rubygems.org will be back up shortly and I won’t have to do again any time soon.I can understand the urge to centralise like Rubygems.org has done with the gem hosting community. The problem is that while you might save some bucks and/or some hassle by centralising, you are multiplying the impact of the inevitable. At least tonight, it doesn’t feel worth it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s