如何解决Mac M1处理器无法使用CocoaPods的问题

最近新换的mac是M1芯片处理器,可能由于是新架构,对一些应用的兼容性不是那么稳定,在使用CocoaPods下载第三方库的时候一直失败,升级也报错

pod search  xxxx
pod install
pod update

都无法正常使用

1、no, an error occurred.
2、Unable to find a pod with name, author, summary, or description matching

因为之前使用xcode打包也遇到了因M1芯片兼容问题打包失败的问题,所以我怀疑无法使用CocoaPods也是M1一起的问题
通过查找资料发现了这个gitHub上的内容可以解决问题:
Got error while trying pod install
应该和Mac中安装的ffi有关,建议修复环境中的ffi.

  • 解决方法
    在终端中输入下面命令,以Rosetta2方式安装,即可成功安装使用CocoaPods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

你可能感兴趣的:(如何解决Mac M1处理器无法使用CocoaPods的问题)