无法在使用Windows的rails中安装JSON gem [英] Cannot install JSON gem in rails using windows
问题描述
我正在做一个捆绑安装,所有的gems都能正常工作,除了JSON,当它到达JSON gem时,我收到了这个错误。
I am doing a bundle install and all of the gems work fine except JSON when it get to the JSON gem I receive this error.
Installing json (1.6.1) with native extensions c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:55
2:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::E
xtensionBuildError)
c:/Ruby192/bin/ruby.exe extconf.rb
checking for 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.
任何关于可能导致此错误的想法?
Any idea on what could be causing this error?
推荐答案
您正在使用Windows,所以RubyInstaller开发工具包可以帮助您:
http://rubyinstaller.org/add-ons/devkit/
You are working with Windows, so the RubyInstaller Development Kit may help you: http://rubyinstaller.org/add-ons/devkit/
devkit安装了一个C编译器(和其他一些东西)来编译C写的部分。
The devkit installs a C-compiler (and some other stuff) to compile C-written parts.
安装它,然后再次尝试安装gem - 也许使用选项 - platform = ruby
。
Install it and try again to install the gem - perhaps with option --platform=ruby
.
详情请参阅 https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
这篇关于无法在使用Windows的rails中安装JSON gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!