Ruby Gems on Ubuntu 8.10

Today I was setting up ruby, rails and capistrano on Ubuntu 8.10.  It turns out that the gems binary path was not in my path.

To fix it, edit your ~/.bashrc file.
gedit ~/.bashrc

Add these lines to the bottom of the file.
#Export the path for Ruby Gems
export PATH=$PATH:/var/lib/gems/1.8/bin

Save it and then source the file (to save you from logging-out and back in again).
source ~/.bashrc

Then you should be able to run capistrano as you would expect.

Please note: There are potential problems with this as Ruby Gems can install system libraries in this path that end up being used instead of the correct system ones.  This can potentially cause problems.  See Launchpad bug #262063 for a discussion of the issue.

About Anthony Batchelor

Job: Software engineer at Mercurytide Hobbies: Guitar/Band, Kendo, Beer Brewing, Simple Electronics, Python hacking.
This entry was posted in Programming, Ruby, Ubuntu. Bookmark the permalink.

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>