无法构建gem原生扩展--Windows中的Ruby

时间:2018-03-07 20:51:32

标签: ruby rubygems bundle bundler

我在Windows 10上遇到一些安装原生扩展的问题。这发生在许多本土宝石上。

C:\Ruby23x64\bin>gem install websocket-driver
Building native extensions. This could take a while...
ERROR:  Error installing websocket-driver:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby23x64/lib/ruby/gems/2.3.0/gems/websocket-driver-0.7.0/ext/websocket-driver
C:/Ruby23x64/bin/ruby.exe -r ./siteconf20180307-13760-qpoxcg.rb extconf.rb
creating Makefile

current directory: C:/Ruby23x64/lib/ruby/gems/2.3.0/gems/websocket-driver-0.7.0/ext/websocket-driver
make "DESTDIR=" clean

current directory: C:/Ruby23x64/lib/ruby/gems/2.3.0/gems/websocket-driver-0.7.0/ext/websocket-driver
make "DESTDIR="
generating websocket_mask-i386-mingw32.def
compiling websocket_mask.c
In file included from c:/Ruby23x64/include/ruby-2.3.0/ruby.h:33:0,
                 from websocket_mask.c:1:
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:131:14: error: size of array 'ruby_check_sizeof_voidp' is negative
In file included from c:/Ruby23x64/include/ruby-2.3.0/ruby.h:33:0,
                 from websocket_mask.c:1:
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_obj_freeze_inline':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1360:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1361:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1362:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1362:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_object_get':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1400:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_object_make':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1414:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_data_typed_object_make':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1421:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_num2char_inline':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1587:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1588:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_class_of':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1949:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_type':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1966:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
In file included from c:/Ruby23x64/include/ruby-2.3.0/ruby.h:33:0,
                 from websocket_mask.c:1:
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_clone_setup':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1997:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1998:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1999:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:1999:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_dup_setup':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2005:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2006:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2006:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_array_len':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2012:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2013:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2013:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_array_const_ptr':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2027:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_struct_len':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2034:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2035:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2035:26: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h: In function 'rb_struct_const_ptr':
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby23x64/include/ruby-2.3.0/ruby/ruby.h:2041:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c: In function 'method_websocket_mask':
websocket_mask.c:26:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:26:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:26:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:30:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:30:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:30:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:31:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:31:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:31:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:32:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:32:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:32:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:35:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:35:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
websocket_mask.c:35:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
make: *** [websocket_mask.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby23x64/lib/ruby/gems/2.3.0/gems/websocket-driver-0.7.0 for inspection.
Results logged to C:/Ruby23x64/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/websocket-driver-0.7.0/gem_make.out

我已经尝试过的事情:

  • 我的rb版本是2.3.3。我的devkit与此版本兼容
  • 执行devkitvars.bat以设置我的变量
  • 安装GCC
  • 尝试使用bundle installgem install <gem name>
  • 安装依赖项

有人可以帮我解决这个问题吗?

0 个答案:

没有答案