Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm inside of the terminal right now and just about to make a new application. I'm inside of the app folder, did rails new --help and pops up:

The program 'rails' can be found in the following packages:
 * rails
 * ruby-railties-3.2
Try: sudo apt-get install <selected package>

and this couldn't be right because I installed rails using these instructions and everything is the latest and up to date:

Why am I getting this prompt? What do I have to do to get Rails working?

share|improve this question
up vote 7 down vote accepted

You get that message when the executable you are trying to run is not in your PATH. You simply need to add the rails installation path to your PATH variable,

    export PATH="$PATH:/path/to/rails"

replacing /path/to/rails with the installation directory (probably something like $HOME/.rvm/.../bin/rails). For convenience, you can add the above line to the end of ~/.bashrc.

Note that it may be more convenient to install this from the Ubuntu repositories; the page you link to is over two years old, and the warning about obsolete packages in the repositories has probably not been applicable for quite some time.

share|improve this answer

I accepted pablomme's answer but ended up doing this

The Ubuntu repositories is all over the place and incorrect, causing too many issues. The blog is up-to-date and I recommend to follow exactly what it says as I skipped the step on

* WARNING: You're using ~/.profile, make sure you load it,
    add the following line to ~/.bash_profile if it exists
    otherwise add it to ~/.bash_login:

      source ~/.profile

Which you MAY run into after doing curl -L | bash -s stable --auto. If you don't than just keep installing as it says and disregard the block below for instructions on how to do it.

Putting source ~/.profile in your Bash Profile

You must do as it says and directly just put that last line above (source ~/.profile) inside of the .bash_profile (not the .bash_profile~) file thats hidden in your HOME directory (it's hidden so do CTRL + H to see it) like this:

source ~/.profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Now continue with the instructions and it will all end up working - just made my first application on Ubuntu, finally!

P.S. You can just do gem install rails when the time comes. Also, this is the command to install the package needed for PostgreSQL as it stated at the end of the blog: sudo apt-get install build-essential libpq-dev

I'm guessing the MySQL is similar: sudo apt-get install build-essential libmysqlclient-dev

Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.