Rails keeps telling me that it's not currently installed

If you're running a rails command immediately after installing rails, you will need to restart your terminal before your commands will be recognized.


I had this problem today. Not completely related to your question, but since this page is what comes up in Google when I search for "Rails is not currently installed on this system", I thought I would add my answer:

What happened is that I was using ruby 1.9.2 with rails for a while, but then I needed to use ruby 1.8.7 to run some other script that I found.

Afterwards, I wanted to change by system back to using 1.9.2, and that's where the problem started:

$ rvm list

=> ruby-1.8.7-p352 [ x86_64 ]
ruby-1.9.2-p290 [ x86_64 ]


$ rvm use 1.9.2

I thought that would do the trick. But no, that gives me the "Rails is not currently installed on this system" message.

What I had forgotten is that I had configured rails using an rvm gemset. So I needed to specify the correct gemset when I was selecting which ruby version to make active.

$ rvm gemset list_all


gemsets for ruby-1.8.7-p352 (found in /Users/asgeo1/.rvm/gems/ruby-1.8.7-p352)
global


gemsets for ruby-1.9.2-p290 (found in /Users/asgeo1/.rvm/gems/ruby-1.9.2-p290)
global
rails31


$ rvm use ruby-1.9.2-p290@rails31

That did the trick.


Mac OS X, rbenv, and rails

I was getting the exact same issue but with rbenv rather than rvm. After verifying a correct .bash_profile.

.bash_profile

export PATH="$HOME/.rbenv/bin:/usr/local/bin:$PATH"

eval "$(rbenv init -)"

Restart the shell

exec $SHELL -l

Check the path

echo $PATH

Finally

I repeatedly installed and uninstalled rails but it was never placed in the .rbenv/bin directory after rbenv rehash. In the end I did a find . -name rails and uninstalled every gem that was returned and uninstalled rails. Then:

$ gem install rails
$ rbenv rehash

$ which rails
/Users/palmerc/.rbenv/shims/rails