1

在我安装 ruby​​ 1.9.3 之后我在我运行 ruby​​ dk.rb install

当我运行 gem install json --platform=ruby 然后我看到:

    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    Impossibile trovare il percorso specificato.
    ERROR:  Error installing json:
         ERROR: Failed to build gem native extension.

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


    Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.0 for inspection.
     Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
4

2 回答 2

0

原生 Gem 扩展通常需要 C 编译器和其他开发工具。我的猜测是您的 Windows 环境中缺少这些工具。您是否在 cygwin bash 窗口中执行此操作?

于 2013-07-10T13:49:02.910 回答
0

尝试运行 gem update --system 1.8.29

然后 gem install json --platform=ruby

它应该工作。

于 2014-10-14T21:44:13.943 回答