You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From time to time I’ve seen the Rails 4.2 tests fail with a few (1-2) examples failing with NoMethodError: undefined method `mysql2_connection' for ActiveRecord::Base:Class. Re-running the test suite usually makes the test pass, and it makes me feel bad for it…
Example:
Database rake tasks::db:create#test_0001_creates the database and all shards:
NoMethodError: undefined method `mysql2_connection' for ActiveRecord::Base:Class
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/activerecord-4.2.9/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/home/travis/build/zendesk/active_record_shards/lib/active_record_shards/tasks.rb:94:in `root_connection'
/home/travis/build/zendesk/active_record_shards/lib/active_record_shards/tasks.rb:40:in `block (3 levels) in <top (required)>'
/home/travis/build/zendesk/active_record_shards/lib/active_record_shards/tasks.rb:31:in `each'
/home/travis/build/zendesk/active_record_shards/lib/active_record_shards/tasks.rb:31:in `block (2 levels) in <top (required)>'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/home/travis/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/home/travis/build/zendesk/active_record_shards/gemfiles/vendor/bundle/ruby/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/home/travis/build/zendesk/active_record_shards/test/helper.rb:75:in `rake'
/home/travis/build/zendesk/active_record_shards/test/tasks_test.rb:42:in `block (3 levels) in <top (required)>'
From time to time I’ve seen the Rails 4.2 tests fail with a few (1-2) examples failing with
NoMethodError: undefined method `mysql2_connection' for ActiveRecord::Base:Class
. Re-running the test suite usually makes the test pass, and it makes me feel bad for it…Example:
cc @pschambacher @grosser
The text was updated successfully, but these errors were encountered: