Topic: command line rails not working

I have an issue using rails from the command line.
I'm using Ubuntu Linux and I have done the following
getopt: invalid option -- 'v'
Terminating...
sudo apt-get install rails -y && sudo gem install rails -V
and both complete properly...
But rails -v doesn't work I get:
getopt: invalid option -- 'v'
Terminating...
... If I do rails new blog it creates all the structures for a folder called blog And one for new...
so things like 'rails server' just creates a new folder and fills it with things...
Here is whereis
ben@acer-e817fae0d9:/var/www/rails$ whereis rails
rails: /usr/bin/rails /usr/share/rails /usr/share/man/man1/rails.1.gz
and gem list --local:
ben@acer-e817fae0d9:/var/www/rails$ gem list --local | grep rails
coffee-rails (3.2.2)
jquery-rails (2.0.1)
rails (3.2.2)
sass-rails (3.2.4)
and my $PATH
bash: /home/ben/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/www/bin: No such file or directory
bash: /home/ben/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/www/bin: No such file or directory
Other things I've found seem to point towards the path variable, and I'm inclined to think I might fix this by linking up to the directory properly
Please help me I'm desperate to get started with rails!
ps I tried to use BBCode code tags but it said they were wrong when they were not >.<

Re: command line rails not working

The command to get the version is 'rails --version' at least for version 2.3 which is what you probably have.  You have installed two versions of rails.  One as a gem using 'gem install rails' (version 3.2) and one using 'apt-get install rails' which is probably version 2.3.  The apt-get version installed rails in /usr/bin so that is the command you get when you use 'rails new xx' and it has behavior consistant with version 2.3.  I would suggest that you 'sudo apt-get remove rails'.  I have sometimes found it necessary to make a link from /usr/bin/rails to the version of rails you want or you can put the rails gem in your path.  Either will work.

YMMV

Re: command line rails not working

Cardiovascular   Technologists perform diagnostic and therapeutic examinations of the heart and blood vessels using ultrasound and monitoring devices and equipment under direction of a licensed physician   Cardiovascular Technology students are prepared to graduate   with training and skills that will prepare them for entry level positions in the field of cardiovascular technology.