ruby-on-rails – 在Ruby 2.4.2上安装带有本机扩展的ffi 1.9.21,Ubuntu 17.10失败

ffi gem 1.9.21安装成功.
我也试过运行这些命令但没有成功.
sudo apt install libffi-dev
gem inst ffi

部署到AWS时会发生此错误.错误看起来像这样.

Installing dotenv 2.2.1
Installing request_store 1.3.2
Installing draper 3.0.1

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/opt/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20180207-2245-1bjhja4.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
creating extconf.h
creating Makefile

  make "DESTDIR=" clean

make "DESTDIR="
Running autoreconf for libffi
/var/app/ondeck/vendor/bundle/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: line 2: exec: autoreconf: not found
make: *** ["/var/app/ondeck/vendor/bundle/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux"/.libs/libffi_convenience.a] Error 127

make Failed,exit code 2

Gem files will remain installed in /var/app/ondeck/vendor/bundle/gems/ffi-1.9.21 for inspection.
Results logged to /var/app/ondeck/vendor/bundle/extensions/x86_64-linux/2.2.0-static/ffi-1.9.21/gem_make.out
An error occurred while installing ffi (1.9.21),and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.21'` succeeds before bundling. (Executor::NonZeroExitStatus)

任何帮助都会很有帮助.提前致谢.

解决方法

好像这个问题是由于ffi的最新版本,我在Gemfile gem’ffi’中指定了ffi最旧的版本,’1.9.18’在控制台中运行bundle install,它解决了我的问题.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...