Open tony-rp opened 6 years ago
Figaro added 747281d
No updates in Figaro gem for last one year. I think it is better to go with dotenv. An advantage of dotenv is we can commit development/test credentials in the repo and gitignore production credentials
@redtachyons can you elaborate on the .gitignore
production credentials part, with an example? I am not familiar with that.
I will reopen this issue.
When I install foreman
it adds dotenv
as well so once you give the example here we can move to dotenv
.
Quoted from https://github.com/bkeepers/dotenv
Can I use dotenv in production?
dotenv was originally created to load configuration variables into ENV in development. There are typically better ways to manage configuration in production environments - such as /etc/environment managed by Puppet or Chef, heroku config, etc.
However, some find dotenv to be a convenient way to configure Rails applications in staging and production environments, and you can do that by defining environment-specific files like .env.production or .env.test.
If you use this gem to handle env vars for multiple Rails environments (development, test, production, etc.), please note that env vars that are general to all environments should be stored in .env. Then, environment specific env vars should be stored in .env.<that environment's name>.
Ie we can keep .env.development safely in repo and gitignore .env.production
@redtachyons Thanks for that information, definitely make sense to change to dotenv
. My reason for choosing Figaro was to split it up based on environments. But seeing writing something as .env.test
and .env.development
will isolate the credentials based on the environment then I would definitely prefer that as multiple files are better than multiple sections in a single file.
https://github.com/laserlemon/figaro