问题描述
我正在尝试安装gem install travis
以根据参考https://rubygems.org/gems/travis使用travis-cli
,但出现错误。
此处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/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I / Library / Developer / CommandLineTools / SDKs /MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I。-D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -g -Os -pipe -DHAVE_GIL_STIN- 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.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/libressl/lib -L / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.12 .internal.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-2.3.0/ruby/ruby.h:24:10:致命错误:找不到'ruby / config.h'文件 #include“ ruby / config.h” ^ ~~~~~~~~~~~~~~ 产生1个错误。 检查的程序是: /* 开始 */ 1:#include“ ruby.h” 2: 3:int main(int argc,char * argv) 4:{ 5:返回0; 6:} / 结尾* /
任何帮助将不胜感激!尝试找出答案,但没有找到帮助
解决方法
这个就行了
sudo gem install -n /usr/local/bin cocoapods -v 1.8.4
最新的 CocoaPods 1.10.0 无法运行。
更新!
如果你想安装 CocoaPods 1.10.0 + 你可以使用 HomeBrew 然后在命令行中输入以下内容
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/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin20 /Library/Developer/CommandLineTools/SDKs/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
,
这是我在 Catalina 10.15.x 上安装 cocoapods verion 1.10.x 的方式
从 Apple Developer Downloads
sudo rm -rf /Library/Developer/CommandLineTools
Install Command Line Tools from .dmg/.pkg
sudo xcode-select --switch /Library/Developer/CommandLineTools
sudo gem install -n /usr/local/bin cocoapods
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer