Ruby 1.9.3中Data Mapper和Sinatra的问题

时间:2013-03-19 19:34:57

标签: ruby sinatra datamapper require

我确信这是一个简单的问题但是因为看了这么长时间我看不到它。所以我用Sinatra,sqlite3,datamapper,dm-sqlite-adapter运行ruby 1.9.3。当我尝试运行Sinatra时,我明白了:

/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>'

以下是前两行:

require 'sinatra'
require 'datamapper'

安装了宝石。 (datamapper(1.2.0))

1 个答案:

答案 0 :(得分:3)

您需要data_mapper,而不是datamapper(请注意下划线):

require 'data_mapper'

请参阅DataMapper getting started page