无法使用 Windows 在 rails 中安装 JSON gem [英] Cannot install JSON gem in rails using windows
问题描述
我正在进行捆绑安装,所有 gem 都可以正常工作,除了 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 找到/开发工具包
这篇关于无法使用 Windows 在 rails 中安装 JSON gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!