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.
Edit
Report