Jul 09 2006

Getting gem to work in Ubuntu Dapper

Published by Adam at 11:44 am under ,

Typically, you would install rubygems like so:

wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
tar xfvz rubygems-0.8.11.tgz

cd rubygems-0.8.11
sudo ruby setup.rb

Unfortunately, attempting to install anything will generate an error:

sudo gem install rails –include-dependencies
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find rails (> 0) in the repository

As I understand it, the Ruby package will look in /usr/lib/ruby/gems, but the rubygems tarball will look in /var/lib/gems. To get around this, create a symbolic link:

sudo ln -s /usr/lib/ruby/gems/ /var/lib/gems
sudo gem update –system
sudo gem install rails –include-dependencies

One Response to “Getting gem to work in Ubuntu Dapper”

  1. Steve Shreeveon 19 Oct 2006 at 12:17 pm

    This works well, but the “double-dash” in front of the “system” and “include-dependencies” options doesn’t copy/paste properly. I think your blogging software is converting the “double-dash” in front of these options into a single “long dash”, which will fail to work if you simply copy/paste from your blog. Can you tweak this? BTW, thanks for the helpful tip!

Comments RSS

Leave a Reply