我正在学习使用Sinatra + Datamapper来构建轻量级的webapp。
我跑了gem install sqlite3 datamapper dm-sqlite-adapter
,似乎已成功安装......
然后我尝试执行以。:/ / p>开头的.rb文件
require 'sinatra'
require 'datamapper'
我收到错误,无法找到datamapper文件。
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- datamapper (LoadError)
我也尝试过'data_mapper',因为在互联网上有关于该宝石的正确拼写的相互矛盾的信息,但结果相同。
然后我列出了所有已安装的宝石(见下文),并且认为没有像datamapper或data_mapper这样的宝石。我这样读过,它是一个元宝石,我猜这意味着它实际上并没有安装那个宝石而是所有以dm开头的宝石?
作为最后的手段,我尝试了gem install data_mapper
我得到了命运的命运:
C:\Users\Manu\Sinatra>gem install data_mapper
Building native extensions. This could take a while...
ERROR: Error installing data_mapper:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
creating Makefile
make
'make' is not recognized as an internal or external command,operable program or batch file.
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.4 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.4/ext/json/ext/parser/gem_make.out
我全身都搜索过,但是找不到任何可以帮我排除故障的事情,所以希望有人用魔杖和尖尖的帽子在这个论坛上漫游!
非常感谢 PS:我正在安装随安装程序安装的ruby 1.9.2p0
*本地宝石*
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
addressable (2.2.6)
arel (2.0.6)
backports (2.3.0)
builder (2.1.2)
bundler (1.0.7)
cgi_multipart_eof_fix (2.5.0)
data_objects (0.10.7)
diff-lcs (1.1.3)
dm-aggregates (1.2.0)
dm-constraints (1.2.0)
dm-core (1.2.0)
dm-do-adapter (1.2.0)
dm-migrations (1.2.0)
dm-sqlite-adapter (1.2.0)
dm-transactions (1.2.0)
do_sqlite3 (0.10.7 x86-mingw32)
erubis (2.6.6)
fastercsv (1.5.4)
gem_plugin (0.2.3)
growl (1.0.3)
i18n (0.5.0)
json_pure (1.6.4)
mail (2.2.12)
mime-types (1.16)
minitest (1.6.0)
mongrel (1.1.5 x86-mingw32)
multi_json (1.0.4)
polyglot (0.3.1)
rack (1.4.0, 1.2.1)
rack-mount (0.6.13)
rack-protection (1.2.0)
rack-test (0.5.6)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
rdoc (2.5.8)
rspec (2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
rspec-mocks (2.8.0)
rubygems-update (1.8.15)
sinatra (1.3.2)
sqlite3 (1.3.5 x86-mingw32)
sqlite3-ruby (1.3.3, 1.3.2 x86-mingw32)
sys-uname (0.9.0 x86-mingw32)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.9)
trollop (1.16.2)
tzinfo (0.3.23)
yard (0.7.4)
答案 0 :(得分:1)
似乎缺少RubyInstaller开发工具包: http://rubyinstaller.org/add-ons/devkit/
devkit安装了一个C编译器(以及make之类的其他东西)来编译C编写的部分。
安装它并再次尝试安装gem - 可能使用选项--platform=ruby
。
详情可在https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
找到