Search code examples
foreman

Why do I get "foreman: command not found" only in a directory *with* a Procfile?


I am on CentOS. I've installed foreman with yum

In my home directory, with no Procfile I get:

$ foreman start
ERROR: Procfile does not exist.

However when I cd into a directory that has a Procfile, for example:

cd ~/supersender

Then the foreman command is unavailable, i.e. forem [tab][[tab] does not complete and I get

$ foreman start
-bash: foreman: command not found

Solution

  • I had the same problem earlier. In one recent project folder, I was able to run 'foreman start', but in an older folder I got:

    $ foreman start
    -bash: foreman: command not found
    

    I suppose adding 'foreman' to the PATH should work too, but the following commands work for me:

    $ sudo gem uninstall foreman
    $ sudo gem install foreman
    $ which foreman
    /Users/liwen/.rvm/rubies/ruby-2.2.3/bin/foreman
    

    I still do not know the discrepancy in seeing 'foreman' between the recent the the old folders earlier, but the above works for me.