提问者:小点点

安装Travis cli时,在macOS中找不到libffi的包配置


我正在尝试安装gem install travis以根据参考使用travis clihttps://rubygems.org/gems/travis但在误差以下。

这里提到的解决方案https://github.com/ffi/ffi/issues/653 :

brew reinstall libffi
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
gem install travis

找不到libffi的包配置“xcrun clang-o conftest-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/Ruby-2.3.0/universal-darwin16-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/2.3/usr/include/Ruby-2.3.0/backward-I/Library/Developer/CommandLineTools/sdk/MacOSX。sdk/System/Library/Frameworks/Ruby。framework/Versions/2.3/usr/include/ruby-2.3。0-I.-dxopen_SOURCE-D_DARWIN_C_SOURCE-D_DARWIN_UNLIMITED_SELECT-D_REENTRANT-g-Os-pipe-DHAVE_GCC_ATOMIC_-BUILTINS-iwithsysroot/usr/local/libressl/include conftest。c-L-L/System/Library/Frameworks/Ruby。framework/Versions/2.3/usr/lib-L.-L/Applications/Xcode。app/Contents/Developer/Platforms/MacOSX。平台/开发者/SDK/MacOSX10。12.内部。sdk/usr/local/libressl/lib-L/Applications/Xcode。app/Contents/Developer/Platforms/MacOSX。平台/开发者/SDK/MacOSX10。12.内部。sdk/usr/local/lib-arch x86_64-arch i386-lruby。2.3.0-lpthread-ldl-lobjc“在conftest.c:1包含的文件中:在/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/Ruby-2.3.0/Ruby.h:33:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/Ruby.h:24:10:f错误:“ruby/config。未找到h'文件#包含“ruby/config.h”^~~~~~~~~~~~~~~~~~~生成错误1。选中的程序是:/*begin*/1:#include“ruby.h”2:3:int main(int argc,char*argv)4:{5:返回0;6:}/end*/

任何帮助都将不胜感激!试着找出答案,但没有发现有帮助


共3个答案

匿名用户

这样就行了

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4

最新的CocoaPods 1.10。0将不起作用。

更新!

如果你想安装CocoaPods 1.10。0您可以使用自制软件,然后在命令行中输入以下命令

brew install cocoapods

匿名用户

我也有同样的问题。我注意到文件被搜索到了

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16

我安装了XCode 12.2及其命令行工具,该工具没有该文件夹,只有universal-darwin20。我通过将文件夹软链接到universal-darwin16解决了这个问题。

从终端:

ln-s/Library/Developer/CommandLineTools/sdk/MacOSX。sdk/System/Library/Frameworks/Ruby。framework/Versions/2.3/usr/include/ruby-2.3。0/universal-darwin20/Library/Developer/CommandLineTools/SDK/MacOSX。sdk/System/Library/Frameworks/Ruby。framework/Versions/2.3/usr/include/ruby-2.3。0/universal-darwin16

匿名用户

多亏了之前的回应,谁符号连接了通用达尔文,我发现我的位置在Xcode应用程序中没有什么不同。对于任何可能需要这个的人:

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin20 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19