json gem不会在Windows上安装 [英] json gem won't install on Windows

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

问题描述

这是我不断收到的错误。

  gem install json -v'1.6.3'
暂时增强PATH包括DevKit ...
构建本机扩展。这可能需要一段时间...
错误:安装json时出错:
错误:无法构建gem本机扩展。

C:/ Program Files / Ruby / Ruby192 / bin / ruby​​.exeextconf.rb
创建Makefile
$ b $ make
Makefile:160 :警告:为目标`C:/ Program'重写命令
Makefile:153:警告:忽略目标`C:/ Program'的旧命令
C:/ Program Files / Ruby / Ruby192 / bin / ruby -e放入'EXPORTS','Init_parser'> par
ser-i386-mingw32.def
/ bin / sh:C:/ Program:没有这样的文件或目录
make:*** [parser-i386-mingw32.def]错误127


Gem文件将继续安装在C:/ Program Files / Ruby / Ruby192 / lib / ruby​​ / gems / 1.9.1 / gems / json-1.6.3中进行检查。
结果记录到C:/ Program Files / Ruby / Ruby192 / lib / ruby​​ / gems / 1.9.1 / gems / json-1.6.3 / ext / json / ext / parser / gem_make.out

有人有解决方案吗?

解决方案

刚刚碰到了这个。通过在Windows上安装dm-types。 (Win7 x64):这个修正了它:




它看起来是Ruby路径中的空格搞砸了makefile。也许尝试在Windows上临时创建符号链接,如:

  mklink / dc:\rubyC:\程序文件x86)\Ruby\Ruby193

然后尝试使用c:\\​​\\ruby\安装bin\ruby.exe。您可以在安装后删除符号链接。


Here is the error I keep getting. I installed DevKit and followed all the instructions.

gem install json -v '1.6.3'
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:/Program Files/Ruby/Ruby192/bin/ruby.exe" extconf.rb
creating Makefile

make
Makefile:160: warning: overriding commands for target `C:/Program'
Makefile:153: warning: ignoring old commands for target `C:/Program'
C:/Program Files/Ruby/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_parser'"  > par
ser-i386-mingw32.def
/bin/sh: C:/Program: No such file or directory
make: *** [parser-i386-mingw32.def] Error 127


Gem files will remain installed in C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3 for inspection.
Results logged to C:/Program Files/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out

Does anyone have a solution to this?

解决方案

Just ran into this as well. Via Installing dm-types on Windows. (Win7 x64): this fixed it:


It looks the the spaces in the path for ruby are screwing up the makefile. Maybe try creating a symlink on Windows temporarily, like:

mklink /d c:\ruby "C:\Program Files (x86)\Ruby\Ruby193"

and then try installing with c:\ruby\bin\ruby.exe. You can delete the symlink after installing.

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

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