Getting gem to work in Ubuntu Dapper

Typically, you would install rubygems like so:

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 thought on “Getting gem to work in Ubuntu Dapper

  1. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>