簡體   English   中英

錯誤無法在Windows 7x64上構建json gem native擴展

[英]error failed to build json gem native extension on windows 7x64

我正在嘗試安裝devkit然后在Windows7 64bits上安裝json gem,我已經安裝了ruby 4.2.4並解壓縮了devkit配置的config.yml並運行ruby dk.rb install然后當我運行gem install JSON時--platform = ruby但它給出了如下錯誤:

 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

對於后人,我基本上問了同樣的問題, Azolo注意到這是因為我錯了,安裝了x86版本的Ruby而不是x64,這與我的機器和devkit相匹配。 刪除舊版本並下載x64版本的Ruby修復了我的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM