我试图在Windows上安装JSON GEM。我安装了devkit。我得到以下错误。有什么建议吗?
d:\source\my_project>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:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
make
generating parser-i386-mingw32.def
compiling parser.c
In file included from parser.rl:1:0:
../fbuffer/fbuffer.h:129:13: warning: 'fbuffer_append_long' defined but not used [-Wunused-function]
../fbuffer/fbuffer.h:136:17: warning: 'fbuffer_dup' defined but not used [-Wunused-function]
../fbuffer/fbuffer.h:149:14: warning: 'fbuffer_to_s' defined but not used [-Wunused-function]
../fbuffer/fbuffer.h:90:13: warning: 'fbuffer_append_str' defined but not used [-Wunused-function]
linking shared-object json/ext/parser.so
make install
/usr/bin/install -c -m 0755 parser.so C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.3/ext/json/ext/json/ext
/usr/bin/install: cannot create regular file `C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.3/ext/json/ext/json/ext': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.3 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
发布于 2018-08-09 14:53:06
我也有这个问题,通过这样做解决了这个问题:
使用Ruby版本-2.2.2
GEM版本-2.3.0(如果您有最新的gem版本安装,可以使用命令降级-gem update --system 2.3.0
)
解压缩后,将路径添加到devkit&mingw\bin到PATH变量,导航到devkit目录并运行以下命令
ruby dk.rb init
ruby dk.rb install
最后,重新启动命令提示符&尝试
gem install json
这对我有用。
https://stackoverflow.com/questions/-100002049
复制相似问题