使用 Apple Silicon 的 Mac 别用 gen 来安装 CocoaPods

新买的 Mac Studio 还未安装过 CocoaPods,因为最近开发的项目都是用 Swift Package Manager。目前仍然有很多项目是使用 CocoaPods,今天从 GitHub 上 Clone 了一个 App 就是使用 CocoaPods。我的一般都是直接安装官网的方式去安装,没必要百度和 Google,但是安装官网的安装命令 sudo gem install cocoapods 安装,是能安装成功的,但是使用时却报错了:

1
2
3
4
5
6
7
8
9
10
11
12
$ pod install
Analyzing dependencies
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x00000001046b4000
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
Read more