0

我确信这是一个简单的问题,但由于我看了这么久,我看不到它。所以我使用 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'

宝石已安装。(数据映射器(1.2.0))

4

1 回答 1

3

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

require 'data_mapper'

See the DataMapper getting started page.

于 2013-03-19T20:36:37.443 回答