bash: rails: command not found


I’ve checked my gems env, appears to be fine.

Is there anything else I can check to see why it is not recognising the Rails command?

I have read a number of post and they all seem to point back to PATH.

BTW: Using Ubuntu OS.



Rvm or apt-get install?

Do you have RVM (or rb-env) installed? Or you use system ruby?

Have you installed rails itself? If so how?

What do you see if do
gem list


are u in the folder on terminal? probally u not in your folder app...

Enviado via iPad

rails command does not depend on the folder. Only if he is trying to use rails server (for example) within a non rails-app directory. And even though, the exception raised is another…

That should not matter when using the rails command, for example to
make a new app using 'rails new' one must not be in an existing app.
It does matter if using rake.


Hey everyone,

I am in terminal

Rails 2.3.8 is installed

Rake is installed

I used sudo apt-get install

Yes, I am inside the app directory :slight_smile:

I did check echo $PATH and noticed it was pointing to a games directory,

so I changed it with export PATH=$PATH:“var/lib/gems/1.8/bin” (example)

then I could access rails -v, to get version, but then script/server was not available.

Any ideas? Looks like its something to do with PATH, I also checked bash.bashrc, although I don’t quite understand bashrc.

PS: I tried to open Gmail inside Ubuntu, but I’m using it through XenCenter, it’s quite slow.

So having to re-type everything out :confused:



what the problem?

ruby script console wont work? if you tryin this whit a rails 2.3.8 its wont work…explain more the problem please, paste the error appears on terminal ok?

Enviado via iPad

That is not the best way of installing rails on Ubuntu. I think you
are best to use rvm.
Then install all the stuff you need for rails development, something like

# dependencies for ruby build
sudo apt-get install build-essential bison openssl libreadline6
libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev
libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf
# extras for mysql gem build
sudo apt-get install libmysql-ruby libmysqlclient-dev
# for nokigiri if required
sudo apt-get install libxslt-dev libxml2-dev

Then install the version of ruby you want within rvm, for example
rvm install 1.9.2

and finally rails
gem install rails

Note the you should not use sudo gem install when using rvm.

Thanks Colin,

great stuff :slight_smile: Will give it a go :slight_smile: