Reputation: 2683
I'm playing around with Sinatra and following a simple tutorial I found online ( http://carlosgabaldon.com/articles/singing-with-sinatra/).
The thing is though, every time I try to enter DataMapper::Database.setup({...
I get uninitialized constant DataMapper::Database (NameError)
.. Any ideas why?
Upvotes: 1
Views: 2312
Reputation: 41
I had that same issue doing the tutorial on Sinatra/DataMapper on RubySource.
The problem was that I wan't calling
require 'dm-sqlite-adapter'
Upvotes: 4
Reputation: 12906
Like others said, you should definitely use some newer/better tutorials. The Getting Started page on DataMapper's website is a good starting point, along with the rest of their docs.
To answer your question, this should connect to your database:
DataMapper.setup(:default, 'sqlite://db/my_way_development')
Upvotes: 1