7

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?

1 Answer 1

15

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

1
  • Thank you Jonah, that pretty much cleared some doubts I had about foreman. Sorry, for the late correct answer selection, though, I was waiting for any alternative perspectives on it. :) Feb 7, 2014 at 20:42

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.