1

我似乎无法在装有 Ruby 1.9.3p194 的 Windows 7 机器上运行捆绑更新。我也安装了最新的 DevKit。bundle抱怨缺少make命令,我在硬盘上找不到make(我搜索过)。我怎样才能让它工作?

C:\website>bundle update
Fetching gem metadata from http://rubygems.org/.........
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.2)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.8)
Using activeresource (3.2.8)
Using bundler (1.1.5)
Using coffee-script-source (1.3.3)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Installing json (1.7.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile

make
'make' is not recognized as an internal or external command,
operable program or batch file.

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.7.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.7.5), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.5'` succeeds before bundling.
4

2 回答 2

2

ruby dk.rb install --force在 DevKit 目录中成功了。

于 2012-09-07T22:06:36.857 回答
0

有些gem需要编译,jsongem就是这种情况。

您可以通过安装 RubyInstaller 的 DevKit 来解决大多数 gem 的编译问题,可从下载页面获得

下载后,请按照RubyInstaller wiki 页面上的安装说明进行操作。

安装后,打开一个新的命令提示符并尝试再次安装有问题的 gem:

gem install json

它应该成功。

那是考虑正确安装了 DevKit。正如 RubyInstaller 邮件列表中所讨论的,您可以强制安装 DevKit:

ruby dk.rb install --force

在 DevKit 目录中。

于 2012-09-07T20:25:57.447 回答