thoughtbot/guides — pull request #238 by gabebw (2014-10-20 17:31:39+00:00)
Title: Use `ENV.fetch` instead of `ENV[]`

It's easy to forget to set environment variables (e.g. `AWS_SECRET_KEY`) on
staging or production. Using `ENV.fetch("AWS_SECRET_KEY")` ensures that
missing environment variables raise errors instead of just being `nil`.

Heroku boots the app on deploy, which runs the app's initializers. Often,
environment variables are set in an initializer. This combination means that
if an environment variable isn't set, an error will be raised and Heroku will
abort the deploy. This means users can never see a version of the app without
the environment variables set.