"Adapter not set"

39 views
Skip to first unread message

Louis

unread,
Aug 19, 2010, 6:46:10 PM8/19/10
to Machinist Users
Hello there,

I'm using Datamapper and Sinatra, and I keep getting this error when I
try to use Machinist:

DataMapper::RepositoryNotSetupError: Adapter not set: default. Did
you forget to setup?

Though, I think that DataMapper is properly set up:

DataMapper.setup(:default, "mysql://root:@localhost/blog")

I found a few posts explaining that the order of the loadings is
important, so I have:

require "machinist/data_mapper"
require "sham"
require "test/blueprints.rb"
require "models/post"

Then in blueprint.rb:

require "machinist/data_mapper"
require "sham"
require "models/post"

Sham.define do
...
end

Post.blueprint do
...
end

10.times { Post.make! }

I would be glad to hear any suggestion you may have. Thank you very
much :-)
Reply all
Reply to author
Forward
0 new messages