#408 ✓resolved
Pavel Kunc (merboutpost)

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

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 »

Tags

Pages