错误:安装ffi时出错:错误:无法构建gem本机扩展 [英] ERROR: Error installing ffi: ERROR: Failed to build gem native extension

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

问题描述

  C:\文档和设置\ ******> gem install ffi 
临时增强PATH以包含DevKit ...
构建本机扩展。这可能需要一段时间...
错误:安装ffi时出错:
错误:无法构建gem本机扩展。

C:/Ruby192/bin/ruby.exe extconf.rb
检查ffi.h ... no
在/ usr / local / include中检查ffi.h ... no
检查rb_thread_blocking_region()...是
检查ruby_thread_has_gvl_p()...是
检查ruby_native_thread_p()...是
检查rb_thread_call_with_gvl ()...是
创建extconf.h
创建Makefile
make
C:/ Ruby192 / bin / ruby​​ -eputs'EXPORTS','Init_ffi_c'> ; ffi_c-i386-mingw32.def
gcc -I。 -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I / C / Ruby192 / include / ruby​​-1
.9.1 / ruby​​ / backward -I / C / Ruby192 / include / ruby​​- 1.9.1 -I。 -DRUBY_EXTCONF_H = \extcon
fh\-O3 -g -Wextra -Wno -unused-parameter -Wno-括号-Wpointer-arith -
Wwrite-strings -Wno-missing-field-初始化程序-Wno-long-long -Wno-declaration -a
fter-statement -o AbstractMemory.o -c AbstractMemory.c
从AbstractMemory.c包含的文件中:28:0:
compat.h:65:20:警告:#ifndef指令结尾的额外标记
compat.h:69:24:警告:#ifndef指令结尾处的额外标记
包含在AbstractMemory中的文件。 h:29:0,从AbstractMemory.c获得
:29:
Types.h:68:17:致命错误:ffi.h:没有这样的文件或目录
编译终止。
make:*** [AbstractMemory.o]错误1

Gem文件将保持安装在C:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0 .1
0进行检查。
记录到C的结果:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0.10/ext/ffi_c/gem_m
ake.out
_________________________________________________________________________________

不知道如何处理这个问题。请帮助。

解决方案

版本1.0.10有问题在Windows上编译。



您可以使用1.0.9

  gem install ffi --version ='1.0.9'


Got the DevKit installed and re-ran the ffi install….got this as an output:

C:\Documents and Settings\******>gem install ffi
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
        ERROR: Failed to build gem native extension.

        C:/Ruby192/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_thread_has_gvl_p()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_ffi_c'"  > ffi_c-i386-mingw32.def
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extcon
f.h\"    -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -
Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-declaration-a
fter-statement   -o AbstractMemory.o -c AbstractMemory.c
In file included from AbstractMemory.c:28:0:
compat.h:65:20: warning: extra tokens at end of #ifndef directive
compat.h:69:24: warning: extra tokens at end of #ifndef directive
In file included from AbstractMemory.h:29:0,
                 from AbstractMemory.c:29:
Types.h:68:17: fatal error: ffi.h: No such file or directory
compilation terminated.
make: *** [AbstractMemory.o] Error 1 

Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0.1
0 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0.10/ext/ffi_c/gem_m
ake.out
_________________________________________________________________________________

Not sure how to deal with this issue. Kindly help.

解决方案

Version 1.0.10 has issues compiling on windows.

You can use the 1.0.9

gem install ffi --version='1.0.9'

这篇关于错误:安装ffi时出错:错误:无法构建gem本机扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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