在Windows中为ruby安装json gem时出错 [英] Error in installing json gem for ruby in windows

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

问题描述

当我尝试创建新的rails项目时,我遇到了与缺乏json gem有关的错误。



当我尝试安装json gem ,会发生此错误:

 临时增强PATH以包含DevKit ... 
构建本机扩展。这可能需要一段时间...
错误:安装json时出错:
错误:无法构建gem本机扩展。

C:/Ruby22-x64/bin/ruby.exe extconf.rb
创建Makefile

makeDESTDIR =clean

使DESTDIR =
产生generator-x64-mingw32.def
编译generator.c
在c:/Ruby22-x64/include/ruby-2.2.0/ruby包含的文件中/ruby.h:29:0,c:/Ruby22-x64/include/ruby-2.2.0/ruby.h中的
:33,$ ../fbuffer/fbuffer.h:5中的
,来自generator.c的
:1:
c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:26:19:致命错误:stdio.h:没有这样的文件或目录
编译终止。
make:*** [generator.o]错误1

失败,退出代码2

Gem文件将保持安装在C:/ Ruby22-x64 /lib/ruby/gems/2.2.0/gems/json-1.8.3进行检查。
记录到C的结果:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/json-1.8.3/gem_make.out


解决方案

有一群依赖在一起的宝石。所以,我不得不一步一步安装。



正如我基于错误消息和逐一做的那样,我忘记了关于这些步骤的提示。 p>

While I am trying to create the new rails project, I face to error that is related to the lack of json gem.

When I try to install json gem, this error happens:

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:/Ruby22-x64/bin/ruby.exe extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from ../fbuffer/fbuffer.h:5,
                 from generator.c:1:
c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:26:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [generator.o] Error 1

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

解决方案

There was a group of gems which are dependent together. So, I had to install step by step.

As I did it based on error messages and one by one, I forgot to make a note about the steps.

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

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