A collection of computer systems and programming tips that you may find useful.
Brought to you by Craic Computing LLC, a bioinformatics consulting company.

Thursday, July 9, 2009

Installing Rails on Ubuntu - Path Problem

There is an annoying issue when installing recent versions of Rails on Ubuntu (and possibly other Linux variants).

You install the necessary gems but when you try to run rails you get this:
# rails -v
The program 'rails' is currently not installed. You can install it by typing:
apt-get install rails
-bash: rails: command not found
You can see that the gem is installed:
# gem list rails
*** LOCAL GEMS ***
rails (2.3.2, 2.2.2)
So where is it? Turns out you need to add this link to your PATH variable (in your .bashrc file for example):
# export PATH=/var/lib/gems/1.8/bin:$PATH
That does the trick:
# rails -v
Rails 2.3.2
You will find mention of this on page 25 of the 3rd Edition of 'Agile Web Development with Rails' but it needs to be more widely known. Gotchas like this that just prevent you from doing anything with a piece of software are BAD NEWS - someone make it go away...


No comments:

Archive of Tips