M1芯片的Mac使用Cocoapods运行pod install报错解决、

公司购买了2020款M1芯片的MacMini主机,系统为最新的macOS 11.2.3

在使用Cocoapods的时候如下报错:

M1芯片的Mac使用Cocoapods运行pod install报错解决、_第1张图片

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.0%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
 - missing compatible arch in ...
   https://github.com/CocoaPods/CocoaPods/issues/10541 [open] [3 comments]
   3 weeks ago

 - I got error when doing pod install, something to do with M1 chip
   https://github.com/CocoaPods/CocoaPods/issues/10569 [open] [2 comments]
   5 days ago

 - CocoaPods compatibility with Apple DTK (Apple Silicon)
   https://github.com/CocoaPods/CocoaPods/issues/9907 [open] [103 comments]
   a week ago

通过文字翻译得知,在这里面把报错可能的解决方案已经给到了。
我们是M1芯片所以属于以下问题方案:

 - I got error when doing pod install, something to do with M1 chip
   https://github.com/CocoaPods/CocoaPods/issues/10569 [open] [2 comments]
   5 days ago

解决方案

在Finder -> 应用程序中找到 -> 终端。


M1芯片的Mac使用Cocoapods运行pod install报错解决、_第2张图片

前将终端的运行方式设置为:使用Rosetta打开

M1芯片的Mac使用Cocoapods运行pod install报错解决、_第3张图片

然后再终端执行pod install

M1芯片的Mac使用Cocoapods运行pod install报错解决、_第4张图片

执行成功。
需要注意的是使用完Cocoapods之后,还需要把Rosetta再调回来。

你可能感兴趣的:(M1芯片的Mac使用Cocoapods运行pod install报错解决、)