2011-05-09 101 views
1

我想知道为什么我得到这个错误,据我所知,我的Devkit是很好的,所有其他的gem在bundle安装和更新之后被正确安装除外JSON宝石。问题是什么?本机扩展安装json(1.5.1)错误

这是错误的样子:

Installing json (1.5.1) with native extensions c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/in 
staller.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) 

c:/Ruby192/bin/ruby.exe extconf.rb 
checking for ruby/re.h... *** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers. Check the mkmf.log file for more 
details. You may need configuration options. 

Provided configuration options: 
      --with-opt-dir 
      --without-opt-dir 
      --with-opt-include 
      --without-opt-include=${opt-dir}/include 
      --with-opt-lib 
      --without-opt-lib=${opt-dir}/lib 
      --with-make-prog 
      --without-make-prog 
      --srcdir=. 
      --curdir 
      --ruby=c:/Ruby192/bin/ruby 
c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) 
    You have to install development tools first. 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header' 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
      from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' 

谢谢!

+0

它可能是Devkit,所以我会尝试重新安装它。谢谢。 – LearningRoR 2011-05-09 02:05:48

回答

2

感谢Joe Cannatti,他帮我解决了这个问题。 我刚刚重新安装Devkit并覆盖所有文件,即使它是相同版本(DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe),在第一次提取和集成时肯定会遇到问题。这也解决了这个跛脚“程序无法启动,因为msvcrt-ruby18.dll从您的计算机丢失”错误。 祝他人好运!

+1

很高兴我能帮忙:) – 2011-05-11 23:23:54