I'm new to using the foreman gem on Rails. I'm running an app on Rails 3.2, Ruby 1.9.3 and Foreman 0.6. I would like to know what happens behind the scenes when I run foreman. Specifically, the difference between running foreman run rails s
versus foreman start
on my local terminal.
I have noticed some differences already. For e.g., a worker runs only when running foreman start
and not when I run foreman run rails s
. But I would like to know the specifics. Where can read more about this, or can someone explain how it works?
foreman start is used to run your application directly from the command line. If no additional parameters are passed, foreman will run one instance of each type of process defined in your Procfile. If a parameter is passed, foreman will run one instance of the specified application type.
Foreman is a tool for managing Procfile-based applications. For example, you can run the Rails server alongside with webpack-dev-server to use live reloading: web: rails server webpacker: ./bin/webpack-dev-server.
See http://ddollar.github.io/foreman/
foreman start
is used to run your application directly from the command line. If no additional parameters are passed, foreman will run one instance of each type of process defined in your Procfile.
foreman run
is used to run one-off commands using the same environment as your defined processes.
run
is useful since your app may depend on environment variables defined in a .env
file being loaded by foreman and which new to be present even when running a single process.
start
allows you to run a complex app environment which requires multiple processes to be fully functional (background job processing in addition to a web server for example).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With