在windows 8.1上安装json错误。

时间:2022-01-20 19:59:36

I have installed rails 4.2.3 and ruby 2.2.2p95 on windows 8.1 x64 . When I try to run "bundle install" the installation fails because of json -v 1.8.3. I already have json version 1.8.1 installed. When I run rubygems update command it does not get updated. If I try to individually run gem install json -v 1.8.3 or gem install json --platform=ruby --version=1.8.3 I get the following error.

我在windows 8.1 x64上安装了rails 4.2.3和ruby 2.2.2p95。当我尝试运行“bundle install”时,安装失败是因为json - v1.8.3。我已经安装了json版本1.8.1。当我运行rubygems更新命令时,它不会被更新。如果我尝试单独运行gem安装json - v1.8.3或gem安装json——平台=ruby——版本=1.8.3,我就会得到以下错误。

ERROR:  While executing gem ... (OptionParser::InvalidArgument)
invalid argument: -platform=ruby

C:\>gem install json --platform=ruby --version=1.8.3
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150719-4308-1m86usl.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127

make failed, exit code 2

Gem files will remain installed in C:/Ruby22-        x64/lib/ruby/gems/2.2.0/gems/json-1
.8.3 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/json-1.8.3/gem_make.out

2 个解决方案

#1


0  

Try this gem install --verbose json -v 1.8.3. This should install the gem.

试试这个gem安装——verbose json -v 1.8.3。这应该安装gem。

#2


1  

Looks like you might have the 32-bit DevKit installed instead. Try uninstalling the DevKit you have and downloading and re-installing the latest 64-bit one. For more detail check out this similar answer:

看起来您可能安装了32位的DevKit。尝试卸载您拥有的DevKit并下载并重新安装最新的64位版本。要了解更多细节,请查看类似的答案:

https://*.com/a/16579088/4034665

https://*.com/a/16579088/4034665

#1


0  

Try this gem install --verbose json -v 1.8.3. This should install the gem.

试试这个gem安装——verbose json -v 1.8.3。这应该安装gem。

#2


1  

Looks like you might have the 32-bit DevKit installed instead. Try uninstalling the DevKit you have and downloading and re-installing the latest 64-bit one. For more detail check out this similar answer:

看起来您可能安装了32位的DevKit。尝试卸载您拥有的DevKit并下载并重新安装最新的64位版本。要了解更多细节,请查看类似的答案:

https://*.com/a/16579088/4034665

https://*.com/a/16579088/4034665