Ruby gem 安装问题 [英] Issue with Ruby gem install

查看:23
本文介绍了Ruby gem 安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按如下方式在 Windows 上安装 json,但它不起作用.请帮助我解决同样的问题.

I am trying to install json on windows as follows, but its not working. Please help me with possible resoultion for the same.

C:Ruby193in>gem install --local json-1.8.1.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json-1.8.1.gem:
        ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20140725-4216-11o740j.rb extconf.rb
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out

推荐答案

RubyGems 2.4.1 不会在 Windows 上的 Ruby 1.9.3 及更早版本中构建原生扩展.

RubyGems 2.4.1 will not build native extensions in Ruby version 1.9.3 and earlier on Windows.

您需要将 RubyGems 降级到 1.8.29.为此,请运行以下命令:

You will need to downgrade RubyGems to 1.8.29. To do this run the following command:

gem update --system 1.8.29

检查 gem 版本:

gem -v
1.8.29

现在再次尝试您的命令:

Now try your command again:

gem install --local json-1.8.1.gem

参考:https://groups.google.com/forum/#!topic/rubyinstaller/k19SeJijpKU/讨论

这篇关于Ruby gem 安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆