1
votes

Configuration values (e.g. 3rd party API key/secret, SMTP config, some paths) can be stored in environment (e.g. .bash_profile file) or config/environment folder (e.g. config/environments/development.rb and etc.).

Are there any reasons why one or the other solution is preferred? It seems that using config/environments is a little easier because everything will be tracked in CVS. I'm wondering if there are any reasons why environment variables should be used instead of specifying values directly in config/environments.

1

1 Answers

3
votes

You should not put this kind of config values in the CVS (what if you hire some developers, do you really want to share credentials with everybody?).

Many solutions are available in the Rails ecosystem, check here.

Its often a matter of having those settings either in ENV or in a yml file.