
ArgumentError: Adapter not set: default. Did you forget to setup?
Reported by Pavel Kunc (merboutpost) | June 23rd, 2008 @ 07:56 AM
I get this exception all the time since this morning update.
Fresh install using sake.
merb-gen app test
copy database.yml.sample to database.yml and put content:
---
# This is a sample database file for the DataMapper ORM
development: &defaults
# These are the settings for repository :default
adapter: postgres
database: flirtme_development
username: flirtme
password: ****
host: localhost
merb-gen model User
merb -i
User.all
ArgumentError: Adapter not set: default. Did you forget to setup?
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.2/lib/dm-core/repository.rb:28:in `adapter'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.2/lib/dm-core/repository.rb:61:in `read_many'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.2/lib/dm-core/model.rb:141:in `all'
from (irb):1
I tried to change database.yml to:
---
# This is a sample database file for the DataMapper ORM
:development: &defaults
# These are the settings for repository :default
:adapter: postgres
:database: flirtme_development
:username: flirtme
:password: ****
:host: localhost
But no change. Only thing which helps me is:
init.rb:
Merb::BootLoader.before_app_loads do
DataMapper.setup(:default, {settings goes here})
end
Comments and changes to this ticket
-
Jonathan Stott (namelessjon) June 23rd, 2008 @ 10:19 AM
I commited a fix for this, so the ticket can probably be closed.
-
Jonathan Stott (namelessjon) June 23rd, 2008 @ 11:07 AM
As an additional note, the old specs didn't break as a result of the Merb change. I'm not sure how to write a spec that would break though.
-
Dan Kubb (dkubb) July 9th, 2008 @ 11:27 PM
- State changed from new to resolved
- Tag set to bug
-
Alexandre Girard February 9th, 2009 @ 07:16 AM
- Tag changed from bug to bug, slice
- Assigned user cleared.
I'm still getting this error within a Slice since 1.0.8.1, and here how I resolved it:
echo 'DataMapper.setup(:default, "sqlite3:sample_development.db") && DataMapper.auto_migrate!' | slice -i
I havn't found before_app_loads inside Slice config.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »