Despite existing checks in the gem, I want to make sure it's not possible to activate better_errors at all in production (eg: erroneous RAILS_ENV configuration set to development, etc).
Here better_errors should be activated only if a .use_better_errors
file is in place and if I'm on Mac OS X.
Not sure if this is necessary given the existing checks in the gem, but I suspect it cannot hurt either.
Next step: find a way to avoid putting them in the Gemfile completely.
If you happen to have an erroneous RAILS_ENV set to development in production, you're going to end up with other problems anyway (and you will have default rails errors anyway).
Perhaps a better approach to the problem would be to configure database.yml only for production and not dev, so the server won't start if you aren't using the right environment.
And to use
bundle install --deployment
when deploying to not install the development and test gems.