rails: Fail Early with misconfigured MySql adapter
Here’s another case where this idea is useful. It’s well-known that the Ruby-based MySQL driver included with Rails isn’t suitable for use in production. In fact, Rails will produce this warning in the log if it is in use:
WARNING: You’re using the Ruby-based MySQL library that ships
with Rails. This library is not suited for production. Please
install the C-based MySQL library instead (gem install mysql).
This can go unnoticed in the log. Instead, we can write a short initializer that detects this condition and aborts the application start if the production server is misconfigured.
Link tagged as: