I am getting below given message while running 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.
I am using:
gem 'rails', '3.2.13'
gem 'mysql'WEBrick 1.3.1
ruby 1.9.3 (2013-02-22) [i386-mingw32]
Can somebody help me knowing - why i am getting this and how to solve it ?
I came across this error message today in Rails 3 app I was upgrading to 3.2.
config/environments/development.rb
Commented out this line and it will work:
config.active_record.auto_explain_threshold_in_seconds = 0.5
above that line it said:
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
and I was using MySQL so I don't really know why it was throwing an error. Hope this helps!
As noted, you could comment out the config, and the error would go away, but it is trying to tell you that you have a slow query, and you'd probably want to know what's going on there.
It should work if you try the mysql2 gem instead of the mysql gem.
This seems like a duplicate of undefined method `explain' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter
UPDATE: As @twelve17 noted, the presence of this message in the log doesn't mean that you have a slow query yet, but that your adapter doesn't support the mechanism this uses to tell you when you do have a slow query. I should have said "You don't want to just turn this functionality off, you'd probably want to use the mysql2 gem so you can see when a slow query comes up"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With