我正在尝试安装 devkit,
然后在 Windows7 64 位上安装 json gem,我已经安装了 ruby 4.2.4 并提取了 devkit 配置的 config.yml 并运行 ruby dk.rb 安装,然后当我运行 gem 安装 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,而不是与我的机器和 devkit 匹配的 x64。删除旧的并下载 x64 版本的 Ruby 解决了我的问题。