3

I had installed rubygems 1.8 and further on I had installed the rails 2.0.2 gem.

When I tried to view the rails version installed through the command rails -v

It didn't work.. I am unable to figure out why I am getting an "invalid option" on executing the command rails -v ( Please refer the below for the same).

mohnish@mohnish-laptop:~/Downloads$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
mohnish@mohnish-laptop:~/Downloads$ gem list

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
rails (2.0.2)
rake (0.8.7)
mohnish@mohnish-laptop:~/Downloads$ rails -v
getopt: invalid option -- 'v'
Terminating...
mohnish@mohnish-laptop:~/Downloads$ 

Could you please help me out on this regard..

Please note I am currently not making use of the ruby version manager(rvm). Please let me know if I could get a solution once I install the rvm.

Thanks for your help..

karthick87
  • 84,713

1 Answers1

1

You can just install the rails package

sudo apt-get install rails

on my system:

$ ruby -v
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
$ rails -v
Rails 2.3.5

Your version numbers will be a bit lower than mine because I am using Ubuntu 10.10.

Zanna
  • 72,471
dv3500ea
  • 37,754
  • I tried out the link... It says that you have a rails package already installed. – boddhisattva Jan 09 '11 at 02:17
  • Some wise person has said never to install the Rails package from the Ubuntu repo. – Zabba Jan 09 '11 at 10:16
  • @mgj - that's strange. You could try sudo apt-get remove rails then sudo gem uninstall rails then sudo apt-get install rails to revert to the repository version only. @Zabba - that 'wise' person was wrong. You should always use repository packages unless there is a good reason not to, like you need a specific version that isn't packages. – dv3500ea Jan 09 '11 at 10:40
  • Thanks for your suggestion, I would consider that option as a last resort. I am trying to figure another way out in the mean time. – boddhisattva Jan 12 '11 at 06:06