CocoaPods安装失败解决方法

简介: CocoaPods安装失败解决方法

出现场景

最新换了个512的大硬盘,重装了MacOS 10.15,安装Cocoapods时,出现以下错误

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210324-1667-1wwdce5.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... yes
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/ext/ffi_c
make "DESTDIR="
make: *** No rule to make target `"/Volumes/macOS', needed by `AbstractMemory.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.0/gem_make.out

解决方法

  1. 可能是系统版本问题,不兼容最新版本,所以直接安装老版本。笔者碰到问题时是2021.07.06,当前最新版本是1.10.1,找一个1.9.3,2020.05发布的,应该兼容10.15。
# 指定版本安装
sudo gem install -n /usr/local/bin cocoapods -v 1.9.3
  1. 使用brew来安装
brew install cocoapods
相关文章
|
Swift iOS开发 Ruby
iOS CocoaPods 使用以及常见问题(上)
iOS CocoaPods 使用以及常见问题
1076 0
|
Web App开发 Android开发 iOS开发
iOS 调试:通过 Safari/Chrome 调试 WebView
iOS 调试:通过 Safari/Chrome 调试 WebView
11307 123
iOS 调试:通过 Safari/Chrome 调试 WebView
|
CDN
Cocoapods报错 [!] CDN: trunk URL couldn't be downloaded: 解决方法
Cocoapods报错 [!] CDN: trunk URL couldn't be downloaded: 解决方法
2181 0
|
9月前
|
人工智能 算法 UED
从"AI投毒者"到"信息营养师":GEO运营的价值观革命
与“AI投毒”的短视做法截然不同,真正的GEO运营应当致力于成为AI系统的“信息共建者”。对AI深层知识掌握足够多的朋友都知道,人工智能的三要素:数据、算法和算力。数据是人工智能的一切构建的基础,而训练AI的初期数据多来自互联网,但这些是早起的网络数据,它也会存在着如不完整、不正确和不客观等情况。
|
iOS开发 MacOS
解决CocoaPods安装卡住反应慢或失败
解决CocoaPods安装卡住反应慢或失败
3786 4
|
数据挖掘 数据处理
JSL语言 -小众语言
【10月更文挑战第10天】
3320 2
|
开发工具 iOS开发
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
1068 2
|
Unix iOS开发 Ruby
Mac 从零安装cocoapods
最近申请换了台 MacBook Pro(之前用的是MacBook Air),一台干净的像小孩子屁股一样的电脑,iOS开发相关的常用软件一个也没有。当下载了item2(本人很不喜欢Mac自带的终端,所以还是习惯的下载了item2,如果有小伙伴需要了解,请点击https://www.jianshu.com/p/93f5c3491954)Xcode和项目后,由于我们项目用了cocoapods,所以不得不安装它。关于cocoapods的介绍就不多说了,下面直接开始安装步骤吧!
Mac 从零安装cocoapods
|
iOS开发
IOS编译出现Command PhaseScriptExecution failed with a nonzero exit code
IOS编译出现Command PhaseScriptExecution failed with a nonzero exit code
4010 2
|
机器学习/深度学习 人工智能 算法
阿里巴巴新模型EMO的技术原理
【2月更文挑战第10天】阿里巴巴新模型EMO的技术原理
2230 2
阿里巴巴新模型EMO的技术原理