Created
March 12, 2010 15:35
-
-
Save jonathan/330433 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
superclass mismatch for class PostgreSQLAdapter (TypeError) | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:189 | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/dependencies.rb:209:in `require' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/dependencies.rb:209:in `require' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/dependencies.rb:197:in `load_dependency' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/dependencies.rb:209:in `require' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:in `establish_connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/railtie.rb:50 | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/lazy_load_hooks.rb:21:in `instance_eval' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/lazy_load_hooks.rb:21:in `run_base_hooks' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/lazy_load_hooks.rb:21:in `each' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/lazy_load_hooks.rb:21:in `run_base_hooks' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/base.rb:2248 | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/fixtures.rb:911:in `setup_fixtures' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:408:in `_run_setup_callbacks' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:88:in `send' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:88:in `Before' | |
When I am on the scope inputs index page # features/step_definitions/web_steps.rb:18 | |
Then I should see "scope_inputs" # features/step_definitions/web_steps.rb:99 | |
ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:330:in `retrieve_connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in `retrieve_connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:95:in `connection' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activerecord/lib/active_record/fixtures.rb:950:in `teardown_fixtures' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:408:in `_run_teardown_callbacks' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:88:in `send' | |
.bundle/ruby/1.8/bundler/gems/rails-master/activesupport/lib/active_support/callbacks.rb:88:in `After' |
It seems to be the same problem. Rails 3 autoloads most things now and database_cleaner opens up the adapters to add a truncate method. I think to fix the problem database_cleaner just needs to require the proper classes first before opening the class. Unfortunately, I haven't had the time to look into it.
I tried the below but it didn't work:
gem 'database_cleaner', :require => false
In spec_helper.rb:
require 'database_cleaner'
I'm not using pg, only mysql.
In the end I reverted to 0.5.0, which works for me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My problem was actually somewhat different, but essentially the same error. I was using a gem that was reopening PostgreSQLAdapter without subclassing AbstractAdapter, causing the error. It didn't exist for me before using bundler because the load order was different, so I don't know if this will help you any. Anyway I thought I would share my solution.