rails/rails — pull request #17175 by aantix (2014-10-04 07:08:27+00:00)
Title: Require environment variables to be defined at startup

Added the config option required_env_vars. This option allows the developer to specify a series of environment variables that must be defined at started, otherwise an exception is thrown.

```
# e.g.
config.required_env_vars = ['rollbar_api_key', 'github_api_key']
```
If ENV['rollbar_api_key'] and ENV['github_api_key'] aren't defined, an exception is thrown and the server fails to startup.

We've had several instances where our ops team forgot to export an API key on the server and it wasn't apparent until later.

Especially useful for systems like Heroku where reliance on environment variables is prevalent for Rails apps.