Peter Marklund

Peter Marklund's Home

Wed October 31, 2007

Rails Plugin: mysql_requirement

I added the plugin mysql_requirement that allows me to check the encoding/charset settings of the MySQL server as well as its version when my Rails application starts up and abort otherwise.


Andre said over 6 years ago:

Hi Peter,

In Rails 2.0, if I add the "MysqlRequirement..." commands to an initializer file, then I can't do "rake db:create" -- it gives an error.

What should I do?


AP said over 4 years ago:

@Andre I had the same problem, and I think I got around it with this in my initializer:

unless defined?(Rake) && Rake.application.top_level_tasks.include?("db:create")
MysqlRequirement.require do |req|