Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between foreman start and foreman run rails server?

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?

like image 597
WinkyCharlie Avatar asked Jan 15 '14 05:01

WinkyCharlie


People also ask

What does Foreman start do?

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.

What is Foreman Rails?

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.


1 Answers

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).

like image 156
Jonah Avatar answered Nov 05 '22 08:11

Jonah