Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 通过RubyGems安装JSON 1.8.1时出错_Ruby On Rails_Ruby_Json - Fatal编程技术网

Ruby on rails 通过RubyGems安装JSON 1.8.1时出错

Ruby on rails 通过RubyGems安装JSON 1.8.1时出错,ruby-on-rails,ruby,json,Ruby On Rails,Ruby,Json,我的操作系统是Windows7 64x Ultimate。我尝试像这样安装json gem: gem install json -v '1.8.1' 但我有一个问题: Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build

我的操作系统是Windows7 64x Ultimate。我尝试像这样安装json gem:

gem install json -v '1.8.1'
但我有一个问题:

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

    C:/Ruby193/bin/ruby.exe -r ./siteconf20150220-2012-1uff8mn.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/js
on-1.8.1/gem_make.out

如何安装json 1.8.1?

这似乎是Rubygems的一个已知错误。看看github上的over


目前尚未修复,但有望很快修复。目前,似乎大多数人必须降级到rubygems 2.3.0才能在Windows上运行。那应该能解决你的问题

您必须将ruby gem更新为最新版本

检查你的ruby现在在哪

$Ruby -v
将其更新为ruby版本2.3.7

$rvm list known
$rvm install 2.3.7
$rvm use 2.3.7 --default
$gem install bundler
看看这个视频
让我知道这是否有用

C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out说什么?您使用的是什么版本的rubygems?