错误未能在 Windows 7x64 上构建 json gem 本机扩展
Posted
技术标签:
【中文标题】错误未能在 Windows 7x64 上构建 json gem 本机扩展【英文标题】:error failed to build json gem native extension on windows 7x64 【发布时间】:2016-02-05 10:59:34 【问题描述】:我正在尝试安装 devkit,然后在 Windows7 64 位上安装 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
【问题讨论】:
我有完全相同的错误。 【参考方案1】:对于后代,我问了基本相同的问题和Azolo noticed that it was because I had the wrong, x86 version of Ruby installed,而不是与我的机器和devkit匹配的x64。删除旧版本并下载 x64 版本的 Ruby 解决了我的问题。
【讨论】:
以上是关于错误未能在 Windows 7x64 上构建 json gem 本机扩展的主要内容,如果未能解决你的问题,请参考以下文章
iPhone 配置实用程序未能找到“Apple 移动设备支持”
安装SQLserver 2008安装程序未能安装Windows PowerShell,错误代码为-214512329