繁体   English   中英

尝试在 macOS Catalina 上安装 Jekyll 时构建 libffi gem 本机扩展的问题

[英]Issues building the libffi gem native extension when trying to install Jekyll on macOS Catalina

编辑:我写了一个更详细的解决方案在我的博客在这里,如果你想通过所有的步骤走。

我正在尝试通过gem install Jekyll在 macOS Catalina 上使用 Ruby install 通过 homebrew gem install Jekyll并且位于/usr/local/opt/ruby/bin/ruby并且我遇到了以下错误

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

current directory:
/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c
/Users/foobar/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20181118-49440-k8mjki.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

current directory:
/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR=" clean

current directory:
/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c
make "DESTDIR="
Running autoreconf for libffi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I m4 --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at
/usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
make: ***
["/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ffi-1.9.21/ext/ffi_c/libffi-x86_64-darwin18"/.libs/libffi_convenience.a]
Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/ffi-1.9.21 for inspection.
Results logged to
/Users/foobar/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-18/2.5.0-static/ffi-1.9.21/gem_make.out

An error occurred while installing ffi (1.9.21), and Bundler cannot continue.

我已经尝试通过xcode-select --install更新我的 Xcode 命令行工具,但我收到以下消息:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

有谁知道如何在我的机器上构建libffi以便 Jekyll 可以将它用作依赖项?

啊啊啊我想通了! 归功于@ffleming 在这里 您需要执行以下操作:

  1. 使用brew reinstall libffi libffi 在brew reinstall libffi
  2. 将新的 brew 安装的 libffi 标志添加到您的 shell 实例中,例如
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
  1. 运行gem install jekyll ,你应该被排序了!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM