运行WEBrick时,我收到的信息低于给定的消息.
auto_explain_threshold_in_seconds is set but will be ignored because
your adapter does not support this feature. Please unset the
configuration to avoid this warning.
我在用:
gem ‘rails’,‘3.2.13’
gem ‘mysql‘WEBrick 1.3.1
ruby 1.9.3 (2013-02-22) [i386-mingw32]
有人可以帮助我知道 – 为什么我得到这个以及如何解决它?
解决方法
如上所述,您可以注释掉配置,错误会消失,但它试图告诉您,您的查询速度很慢,而您可能想知道那里发生了什么.
如果你尝试mysql2 gem而不是mysql gem它应该工作.
这似乎是undefined method `explain’ for #<ActiveRecord::ConnectionAdapters::MysqlAdapter的重复
更新:正如@127所指出的那样,日志中存在此消息并不意味着您的查询速度很慢,但是您的适配器不支持这种用于告诉您何时查询速度慢的机制.我应该说“你不想只关闭这个功能,你可能想要使用mysql2 gem,这样你就可以看到一个慢速查询出现的时候”