安装ffi时出现错误。

3
我不知道上下文信息,但是这句话的字面意思是“无法解决这个问题”。
$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

有什么想法吗?


安装 libffi-dev。这是哪个发行版? - vee
尝试运行 yum install libffi-devel - vee
我收到了 - 此系统未在RHN注册。 RHN支持将被禁用。 从缓存的主机文件中加载镜像速度 设置安装过程 没有可用的libffi-devel软件包。 无事可做。 - blue01
确保已启用EPEL。然后执行yum install rubygem-ffi。 - ptierno
3个回答

1

在此之前尝试一下

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

bundle install ffi

它对我有效


0

0

我必须将gcc设置为4.2版本,这样它就能正常工作了。我还在Gemfile.lock文件中将ffi的版本更改为1.0.9。

export PATH=/opt/gcc-4.2.0/bin/:$PATH


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接