Take the 2-minute tour ×

I'm starting my first Sinatra App and I'm trying to use DataMapper. Everything is in the very early stages, as I can't get it to actually create the DB. I get "LoadError: no such file to load -- dm-sqlite-adapter" when I try to visit my page.

Here's the code from my Sinatra App so far:

require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-timestamps'
# Also tried require 'datamapper' , but the same issue shows up

DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/raffle.db")

class Raffle 
    include DataMapper::Resource

    property :id,           Serial
    property :firstName,    String
    property :lastName,     String
    property :email,        String
    property :created_at,   DateTime


# Create, upgrade, or migrate DB Tables

I have the gems installed, as gem list outputs:

*** LOCAL GEMS ***

activemodel (3.0.9, 3.0.3)
activerecord (3.0.9, 3.0.3)
activesupport (3.0.9, 3.0.3)
addressable (2.2.6)
arel (2.0.10, 2.0.4)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.15)
data_objects (0.10.6)
datamapper (1.1.0)
diff-lcs (1.1.2)
dm-aggregates (1.1.0)
dm-constraints (1.1.0)
dm-core (1.1.0)
dm-migrations (1.1.0)
dm-serializer (1.1.0)
dm-timestamps (1.1.0)
dm-transactions (1.1.0)
dm-types (1.1.0)
dm-validations (1.1.0)
do_sqlite3 (0.10.6)
fastercsv (1.5.4)
ffi (0.6.3)
i18n (0.5.0, 0.4.2)
json (1.5.3, 1.4.6)
mime-types (1.16)
rack (1.3.0, 1.2.1)
rack-test (0.5.6)
rake (0.8.7)
require_all (1.2.0)
rspec (2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec-mocks (2.6.0)
shotgun (0.9)
sinatra (1.2.6, 1.1.0)
sqlite3 (0.1.1)
stringex (1.2.1)
tilt (1.3.2, 1.1)
typhoeus (0.2.4, 0.2.0)
tzinfo (0.3.29, 0.3.23)
uuidtools (2.1.2)

Any advice/insight is always appreciated.

share|improve this question
add comment

3 Answers

up vote 16 down vote accepted

I don't see the dm-sqlite-adapter gem in that list. Try installing it.

share|improve this answer
That was it. I read somewhere that it was included it dm-migrations, and didn't need to be included. Thank you so much! –  YuKagi Jul 4 '11 at 10:25
add comment

It may be a bit late for the original question, but in case anyone has a similar issue, putting an underscore "data_mapper" in require 'data_mapper' worked for me.

share|improve this answer
Worked for me, thanks! –  AdrianoFerrari Dec 9 '11 at 2:15
Worked for me too. Are these different gems? –  nikhil Jul 5 '12 at 20:03
Confirmed for me as well :) –  Aaron Foltz Aug 19 '12 at 17:12
are they different gems? –  Kit Ho Sep 8 '12 at 17:14
They are technically different gems (with different download counts, etc) but they appear to have the same commit history. See rubygems.org/gems/datamapper vs rubygems.org/gems/data_mapper –  user456584 Feb 19 '13 at 23:30
add comment

You always need to explicitly add an adapter gem to your gemfile. Even data_mapper meta gem doesn't require any of the adapters.

share|improve this answer
add comment

Your Answer


