#1512 new
ahto

DataObjects::ConnectionError when loading both dm-mysql-adapter and dm-sqlite-adapter gems

Reported by ahto | May 17th, 2011 @ 08:13 AM

I have in my Gemfile both dm-mysql-adapter and dm-sqlite-adapter. First for prod/dev and sqlite for speedy tests. I load them using bundler and now when I run tests even though I specifically setup with DataMapper.setup(:default, "sqlite::memory:") it tries to connect somewhere else using some default rules with root@localhost. My code runs after I comment out dm-mysql-adapter from Gemfile.

Gemfile has

gem 'datamapper', '1.1.0'
gem 'dm-mysql-adapter', '1.1.0'
gem 'dm-sqlite-adapter', '1.1.0'

I setup them with

Bundler.setup
DataMapper.setup(:default, "sqlite::memory:")

Expected behaviour

Datamapper would connect to in memory sqlite database

What really happens

DataObjects::ConnectionError: Access denied for user 'root'@'localhost' (using password: NO)

Backtrace

DataObjects::ConnectionError: Access denied for user 'root'@'localhost' (using password: NO)
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/connection.rb:79:in `initialize'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/connection.rb:79:in `new'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/pooling.rb:177:in `block in new'
<internal:prelude>:10:in `synchronize'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/pooling.rb:172:in `new'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/pooling.rb:119:in `new'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/data_objects-0.10.5/lib/data_objects/connection.rb:68:in `new'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:251:in `open_connection'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-transactions-1.1.0/lib/dm-transactions/adapters/dm-do-adapter.rb:69:in `open_connection'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:276:in `with_connection'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:33:in `select'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-sqlite-adapter.rb:43:in `table_info'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-sqlite-adapter.rb:18:in `storage_exists?'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:63:in `storage_exists?'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:118:in `storage_exists?'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-constraints-1.1.0/lib/dm-constraints/migrations.rb:36:in `auto_migrate_down_constraints!'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:45:in `block in repository_execute'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/descendant_set.rb:66:in `block in each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/subject_set.rb:212:in `block in each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/ordered_set.rb:321:in `block in each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/ordered_set.rb:321:in `each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/ordered_set.rb:321:in `each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/subject_set.rb:212:in `each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-core-1.1.0/lib/dm-core/support/descendant_set.rb:65:in `each'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-migrations-1.1.0/lib/dm-migrations/auto_migration.rb:44:in `repository_execute'
/home/ahto/.rvm/gems/ruby-1.9.2-p180@ultra/gems/dm-constraints-1.1.0/lib/dm-constraints/migrations.rb:10:in `auto_migrate!'
spec/models/account_spec.rb:8:in `block (2 levels) in <top (required)>

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages