Installing json (1.5.1) with native extensions error
i wanted to know why i am getting this error, my Devkit is good to go as far as i know, all other gems are being installed correctly after bundle install and update except the JSON gem. What is the problem?
This is how the error looks:
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开发者_如何学Go/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'
Thank you!
Thanks to Joe Cannatti, he helped me figure out the issue. I just reinstalled Devkit and overwrite all files even it was the same version (DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe), must've had issues on first extraction and integration. Which also fixed this lame "program can't start because of msvcrt-ruby18.dll is missing from your computer" error too. Good luck to others!
I had to use RVM to remove ruby, rvm remove 1.9.2
, and reinstalled 1.9.2, now installing gems with native extensions is working. Note: I also made sure I had command line tools installed.
Source: https://github.com/flori/json/issues/78#issuecomment-1499920
精彩评论