2011-05-09 102 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