错误无法在Windows 7x64上构建json gem本机扩展 [英] error failed to build json gem native extension on windows 7x64

查看:109
本文介绍了错误无法在Windows 7x64上构建json gem本机扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装devkit,然后在Windows7 64bits上安装json gem,我已经安装了ruby 4.2.4&.提取devkit配置的config.yml并运行ruby dk.rb install,然后在我运行gem时安装JSON --platform = ruby​​,但它给出如下错误:

I am trying to install devkit and then to install json gem on Windows7 64bits, I have installed ruby 4.2.4 & extracted devkit configured config.yml and run ruby dk.rb install and then when i run gem install JSON --platform=ruby but it gives error as follows :

 current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/json-1.8.3/ext/json/ext/generator
    C:/Ruby22/bin/ruby.exe -r ./siteconf20160205-1668-13fh07v.rb extconf.rb
    creating Makefile

    current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/json-1.8.3/ext/json/ext/generator
    make "DESTDIR=" clean

    current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/json-1.8.3/ext/json/ext/generator
    make "DESTDIR="
    generating generator-i386-mingw32.def
    compiling generator.c
    In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                     from ../fbuffer/fbuffer.h:5,
                     from generator.c:1:
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array 'ruby_check_sizeof_voidp' is negative
    In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                     from ../fbuffer/fbuffer.h:5,
                     from generator.c:1:
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_freeze_inline':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_data_object_get':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1192:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_written':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_num2char_inline':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_class_of':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1670:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_type':
    c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1687:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    In file included from generator.c:1:0:
    ../fbuffer/fbuffer.h: In function 'fbuffer_append_str':
    ../fbuffer/fbuffer.h:127:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    ../fbuffer/fbuffer.h:127:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    ../fbuffer/fbuffer.h:127:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'convert_UTF8_to_JSON_ASCII':
    generator.c:129:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:129:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:129:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:130:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:130:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:130:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'convert_UTF8_to_JSON':
    generator.c:227:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:227:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:227:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:228:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:228:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:228:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_configure':
    generator.c:553:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:553:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:553:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:554:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:554:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:554:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:561:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:561:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:561:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:562:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:562:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:562:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:569:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:569:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:569:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:570:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:570:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:570:40: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:577:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:577:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:577:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:578:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:578:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:578:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:585:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:585:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:585:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:586:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:586:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:586:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'set_state_ivars':
    generator.c:634:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:634:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:634:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:636:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:636:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:636:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'generate_json_object':
    generator.c:721:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:721:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:721:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'generate_json_array':
    generator.c:767:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:767:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:767:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'isArrayOrObject':
    generator.c:924:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:924:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:924:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:925:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:925:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:925:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_indent_set':
    generator.c:1049:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1049:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1049:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1058:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1058:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1058:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_space_set':
    generator.c:1087:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1087:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1087:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1096:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1096:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1096:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_space_before_set':
    generator.c:1123:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1123:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1123:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1132:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1132:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1132:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_object_nl_set':
    generator.c:1161:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1161:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1161:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1169:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1169:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1169:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c: In function 'cState_array_nl_set':
    generator.c:1196:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1196:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1196:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1204:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1204:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    generator.c:1204:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    make: *** [generator.o] Error 1

    make failed, exit code 2

推荐答案

对于后代,我提出了基本相同的问题,并且

For posterity, I asked basically the same question and Azolo noticed that it was because I had the wrong, x86 version of Ruby installed instead of x64 which matches my machine and devkit. Deleting the old one and downloading an x64 version of Ruby fixed my issue.

这篇关于错误无法在Windows 7x64上构建json gem本机扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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