[英]Issues building the libffi gem native extension when trying to install Jekyll on macOS Catalina
EDIT: I wrote up a more detailed solution on my blog here if you want to walk through all the steps.编辑:我写了一个更详细的解决方案在我的博客在这里,如果你想通过所有的步骤走。
I'm trying to install Jekyll via gem install Jekyll
on macOS Catalina using Ruby install via homebrew and located at /usr/local/opt/ruby/bin/ruby
and I'm running into the following error我正在尝试通过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.
I've already tried updating my Xcode Command Line tools via xcode-select --install
but I got back the following message:我已经尝试通过xcode-select --install
更新我的 Xcode 命令行工具,但我收到以下消息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Does anyone know how I can build libffi
on my machine so that I Jekyll can use it as a dependency?有谁知道如何在我的机器上构建libffi
以便 Jekyll 可以将它用作依赖项?
Aaaaaand I figured it out!啊啊啊我想通了! Credit to @ffleming here .归功于@ffleming 在这里。 Here's what you need to do:您需要执行以下操作:
brew reinstall libffi
使用brew reinstall libffi
libffi 在brew reinstall libffi
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
gem install jekyll
and you should be sorted!运行gem install jekyll
,你应该被排序了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.