I've installed new Rails 3.1.3 using gem
# gem install rails
Then type:
wbednarski@mbp13:~$ rails
Rails is not currently installed on this system.
To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
More WTF:
wbednarski@mbp13:~$ which rails
/usr/bin/rails
How is it possible that command rails
exist but Rails is not installed and how to fix it?
EDIT:
wbednarski@mbp13:~$ sudo gem install rails
Password:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
then
wbednarski@mbp13:~$ rails -v
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
I would recommend not using the system installed ruby or install gems in the system directories. There are a couple projects out there for handling installations of different ruby versions and gems. The first and most well known is rvm. The other one I know about is rbenv. RVM might be a good choice to start with and you can decide later on if you want to try rbenv.
RVM is beneficial since it installs to your local home directory whichever ruby version you want and the gems too. This alleviates the issue of needing the correct permissions and $PATH issues.
I had similar problem on my Mac OS X (Lion)
According which rails
I got path /usr/bin/rails
So I made simple workaround:
$ find / -name rails
or similar ("/usr/local/Cellar/ruby/1.9.3-p194/bin/rails" in my case )$ sudo mv -v /usr/bin/rails /usr/bin/rails_old
$ sudo ln -s /usr/local/Cellar/ruby/1.9.3-p194/bin/rails /usr/bin/rails
Should help.
Be aware! This is temporary solution and I don't think that is proper one. It's can be cause by ruby upgrading to version 1.9.3 using brew or something similar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With