Foreman has an environment option that can be used to load custom .env
files. You could try using that to set the environment to production.
For example, if you had a development.env
file containing the following:
RAILS_ENV=development
You could get Foreman to load it like this:
foreman export -e development.env -c worker=3,worker_slow=2,clock=1 upstart /etc/init
Then if you need to reference the environment in your Procfile
(example assumes sidekiq worker):
worker: bundle exec sidekiq --environment $RAILS_ENV
Heroku has a nice article on setting up a .env
file for use with Foreman.