ruby - 安装 ffi 时出错

标签 ruby linux ffi

似乎可以解决这个问题。

$gem install ffi
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
ERROR: Failed to build gem native extension.

/remote/part/usern/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

make
libffi.gnu.mk:16: Extraneous text after `else' directive
libffi.gnu.mk:18: *** only one `else' per conditional.  Stop.


Gem files will remain installed in /remote/part/usern/.rvm/gems/ruby-1.9.3-p448@myrailsapp/gems/ffi-1.9.0 for inspection.
Results logged to /remote/part/usern/.rvm/gems/ruby-1.9.3-p448@myrailsapp/gems/ffi-1.9.0/ext/ffi_c/gem_make.out

有什么想法吗?

最佳答案

先试试这个

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
apt-get install ruby{version}-dev

bundle install ffi

对我有用

关于ruby - 安装 ffi 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18283291/

相关文章:

ruby 控制台 : How to Keep 'gets' from adding a new line when the user inputs

linux - 在不相关的进程之间共享 futex

ruby - 如何在 Ruby 中干掉两个函数?

ruby - 要求 OS X Brew 库安装错误

linux - 如何在 Linux/CentOS 中从 JMeter 执行 jar 文件

rust - 如何在不实例化的情况下在 Rust 中获取结构字段的大小

rust - 在 C 库的回调函数中使用对类型参数的引用

haskell - 使用 Haskell 链接外国 C 库

ruby - 如何在事务中发生 DataMapper 回调?

java - 如何设置Java线程的cpu核心亲和性?