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 使用以及常见问题
1121 0
|
算法 生物认证 开发工具
Guideline 5.1.2 - Legal - Privacy - Data Use and Sharing
你的应用程序收集的设备信息可能包括以下一些:attributesOfItemAtPath:error:, NSLocaleCountryCode, NSFileSystemSize, NSHomeDirectory,和serviceSubscriberCellularProviders。
1243 0
|
11月前
|
人工智能 算法 UED
从"AI投毒者"到"信息营养师":GEO运营的价值观革命
与“AI投毒”的短视做法截然不同,真正的GEO运营应当致力于成为AI系统的“信息共建者”。对AI深层知识掌握足够多的朋友都知道,人工智能的三要素:数据、算法和算力。数据是人工智能的一切构建的基础,而训练AI的初期数据多来自互联网,但这些是早起的网络数据,它也会存在着如不完整、不正确和不客观等情况。
|
iOS开发 MacOS
解决CocoaPods安装卡住反应慢或失败
解决CocoaPods安装卡住反应慢或失败
3889 4
|
开发工具 iOS开发
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
1172 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
4113 2
|
机器学习/深度学习 人工智能 算法
阿里巴巴新模型EMO的技术原理
【2月更文挑战第10天】阿里巴巴新模型EMO的技术原理
2301 2
阿里巴巴新模型EMO的技术原理
|
前端开发 编译器 测试技术
Kotlin Multiplatform 跨平台开发的优化策略与实践
本文深入讲解Kotlin Multiplatform(KMP)的优化策略与实践。KMP是由JetBrains推出的开源技术,允许跨平台共享代码同时保持原生优势。文章覆盖KMP核心概念、性能优化技巧(如代码结构优化、利用`expect`/`actual`关键字、Kotlin/Native性能特性等),以及在移动、桌面和Web应用的实际案例分析。此外,还介绍了如何利用KMP生态系统工具进行快速开发,并展望了KMP的未来发展。
1029 0
|
iOS开发
Xcode 10.2.1 Error:Multiple commands produce问题及解决方案
Xcode 10.2.1 Error:Multiple commands produce问题及解决方案
2015 0