buford.collins
buford.collins

Reputation: 43

Force start Rails application through foreman only

I am using foreman in my Rails application and all works fine when I run foreman start but sometime I forget it and run only Rails application as rails s. Then I spend some time trying to investigate problems related to not working services (like sidekiq).

So, can somebody recommend a way how to force starting my application through foreman only? In other cases I want to see error message.

Upvotes: 0

Views: 69

Answers (1)

Andy Waite
Andy Waite

Reputation: 11076

You could add an environment variable to .env, which is read when Foreman starts, and then check for its presence in a Rails initializer.

Upvotes: 2

Related Questions