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 am following this tutorial of Heroku. I installed foreman with

sudo gem install foreman

but when I try to use this in the terminal with command


this returns

foreman: command not found

share|improve this question

migrated from Nov 23 '11 at 1:28

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

I would check where gem installs executables into and add that directory to your PATH.

share|improve this answer
gem install foreman 

was all I needed to do

However, when I followed the deb instructions on this page: I had lots of issues...Eventually, I completely uninstalled before running gem install foreman. Then it worked like a charm.

share|improve this answer

Just got the same error: foreman command not found.
I managed to succeed removing my gem with:

sudo gem uninstall foreman

And re-install it back with rvm.

rvm gem install foreman

Good luck!

share|improve this answer
This gave me the clue for getting it to work with rbenv: gem install foreman; rbenv rehash – B Seven Sep 21 '12 at 18:19

You haven't given quite enough information for the problem to be properly diagnosed. (Eg, give a link to the tutorial, indicate if you tested foreman by itself, and tell us what "this" is, ie what command you entered or selected.)

If the install appeared to be ok, and if which foreman reports a reasonable path to foreman, and if the invocation that failed is in a non-interactive shell, then the usual problem is a different $PATH value in that shell, and the usual solution is to specify a fully-qualified path.

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.