Thursday, August 27, 2009

Using Aptana for Ruby on Rails development on (K)Ubuntu 9.04 - "Rails not found"

Try using Aptana IDE on (K)Ubuntu 9.04 for developing rails apps and you would run into this problem pretty quickly. Somehow on Ubuntu, the executable "rails" is not installed in the standard /usr/bin or /usr/local/bin. Instead it is only present in /var/lib/gems/1.8/bin/. This means that Aptana cannot find rails even though it was installed using the standard distribution specific package manager.

The fix though is simple - Either create a symlink to rails by doing

sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails
sudo ln -s /var/lib/gems/1.8/bin/rake /usr/bin/rake

Or even better - do what this post suggests -

cd /usr/local/bin
sudo ln -s /usr/bin/ruby ruby
sudo ln -s /usr/bin/ri ri
sudo ln -s /usr/bin/rdoc rdoc
sudo ln -s /var/lib/gems/1.8/bin/rails rails
sudo ln -s /var/lib/gems/1.8/bin/rake rake

3 comments:

Fabrício Lemos said...

Thank you for this workaround. I reported the problem to RadRails so they can work it out: https://radrails.tenderapp.com/discussions/problems/82-radrails-ignores-rails-path-setup

faber said...

you saved me day :)

CESA Project said...

Thanks you so much!