在ubuntu 16.04上安装fpm时出错

时间:2018-02-09 22:22:04

标签: ruby debian ubuntu-16.04

Ubuntu 16.04计算机上的fpm安装失败,错误日志如下。很长一段时间没有问题,并且包含的​​apt包没有变化。

最初为fpm安装的软件包为ruby-devgcc。我还尝试了rubygemsbuild-essentialautoconfautogenautomakepkg-configlibgtk-3-dev和{{1}但无济于事。

apt-utils

========================================

sudo gem install --no-rdoc --no-ri fpm
Fetching: cabin-0.9.0.gem (100%)
Successfully installed cabin-0.9.0
Fetching: backports-3.11.1.gem (100%)
Successfully installed backports-3.11.1
Fetching: arr-pm-0.0.10.gem (100%)
Successfully installed arr-pm-0.0.10
Fetching: clamp-1.0.1.gem (100%)
Successfully installed clamp-1.0.1
Fetching: ffi-1.9.21.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing fpm:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20180209-1204-u28w9m.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

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi/autogen.sh: 2: exec: autoreconf: not found
libffi.mk:6: recipe for target '"/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a' failed
make: *** ["/var/lib/gems/2.3.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a] Error 127

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.21 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/gem_make.out

1 个答案:

答案 0 :(得分:7)

安装ffi gem失败了。您需要安装然后重试。您可能想要系统的ffi库,所以我会尝试

sudo apt-get install libffi-dev

然后

gem install ffi
然后重试。如果之后找不到ffi.h文件,那么只需确定标题的安装位置,并使用标记将其包含在gem install ffi