0

I am sure this is a simple issue but since I have looked so long I cannot see it. So I am running ruby 1.9.3 with Sinatra, sqlite3, datamapper, dm-sqlite-adapter. When I try to run Sinatra, I get this:

/Users/XXX/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- datamapper (LoadError)
from /Users/XXX/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from app.rb:2:in `<main>'

Here are the first two lines:

require 'sinatra'
require 'datamapper'

The gem is installed. (datamapper (1.2.0))

Red
  • 2,256
  • 5
  • 25
  • 38
  • Are you using Bundler? RVM? – ian Mar 19 '13 at 19:38
  • 1
    Then I'd suggest create a new gemset just for this project, and then installing the gems again into it and see if you still get the problem. If you decide to use Bundler (which I think is better at gem management, RVM for management of rubies) then try `bundle install --binstubs --path vendor` to sandbox the gems, then try running via `bundle exec ruby app.rb` or `bin/rackup config.ru` (whichever fits best). – ian Mar 19 '13 at 19:44

1 Answers1

3

You need to require data_mapper, not datamapper (note the underscore):

require 'data_mapper'

See the DataMapper getting started page.

matt
  • 78,533
  • 8
  • 163
  • 197