Foreman is a gem (aka manager) for managing multiple processes that your rails application is depending upon when running in development environment and also has a option to move it into production environment as well. It is based on a Procfile that we have to create in our rails root and in that file we have to mention the process to be start by just one command i.e. foreman start
foreman start is the command to start the process those are mentioned in the Procfile. It can be rails server, background jobs worker like delayed jobs, redis server etc
Example:
web: bundle exec rails server -p 3001 -e development
dj: RAILS_ENV=development bundle exec rake jobs:work
the first line is to run a rails server in 3001 port in development environment. The second is to run the workers.
Note: Never include foreman gem in your rails gem file.
0 Comment(s)