6

I prefer not to use dotenv, but really would like to use the foreman gem. Will it work with figaro?

Currently I use my own yaml files for loading env variables, and I store them in the root of my project under a .env directory. It seems that foreman tries to read a .env file, and chokes on my .env directory.

So alternatively to using figaro, is there a way to change where foreman looks for my env variables?

1 Answer 1

0

I've been using foreman (0.78) with figaro (1.1.1) in my Rails (4.2) app with no problems. Currently, figaro requires that all variables are in config/application.yml file or set in ENV. Foreman will always try load .env file if it exists (unfortunately they don't distinguish between file and directory in their check) unless you specify your .env files with - e

I think you have 3 options:

1) Use figaro and move your custom .yml files into config/application.yml

2) Point foreman to a custom .env file as a workaround (it has to exist though): touch .emptyenv foreman start -e .emptyenv

3) Rename .env directory to something else, e.g. '.custom_env'

I hope that helps.

Your Answer

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

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