CocoaPods 在 m1 上安装有问题

CocoaPods install having trouble on m1

我尝试过许多不同的方式安装 cocoapods,但是 运行遇到了一个严重的错误

当我 运行 pod list 我得到以下错误

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.

-- Control frame information -----------------------------------------------
c:0039 p:---- s:0221 e:000220 CFUNC  :getdtablesize
c:0038 p:0050 s:0217 e:000216 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:36
c:0037 p:0075 s:0214 e:000213 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:27
c:0036 p:0007 s:0211 e:000210 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:3
c:0035 p:0007 s:0208 e:000207 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:2 [FINISH]
c:0034 p:---- s:0205 e:000204 CFUNC  :require
c:0033 p:0110 s:0200 e:000199 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0032 p:0128 s:0188 e:000187 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:29
c:0031 p:0007 s:0185 e:000184 CLASS  /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:14
c:0030 p:0049 s:0182 e:000181 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curl.rb:9 [FINISH]
c:0029 p:---- s:0179 e:000178 CFUNC  :require
c:0028 p:0110 s:0174 e:000173 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0027 p:0049 s:0162 e:000161 TOP    /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon.rb:16 [FINISH]
c:0026 p:---- s:0159 e:000158 CFUNC  :require
c:0025 p:0110 s:0154 e:000153 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0024 p:0013 s:0142 e:000141 TOP    /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2 [FINISH]
c:0023 p:---- s:0139 e:000138 CFUNC  :require
c:0022 p:0110 s:0134 e:000133 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0021 p:0006 s:0122 e:000121 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:440
c:0020 p:0045 s:0114 e:000113 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:372
c:0019 p:0318 s:0103 e:000102 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:365
c:0018 p:0006 s:0093 e:000092 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:338
c:0017 p:0059 s:0088 e:000087 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:53
c:0016 p:0021 s:0084 e:000083 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source.rb:31
c:0015 p:0030 s:0079 e:000078 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:30 [FINISH]
c:0014 p:---- s:0074 e:000073 CFUNC  :new
c:0013 p:0068 s:0069 e:000065 BLOCK  /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315 [FINISH]
c:0012 p:0039 s:0061 E:0023b8 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322
c:0011 p:0007 s:0054 e:000053 BLOCK  /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331 [FINISH]
c:0010 p:---- s:0050 e:000049 CFUNC  :map
c:0009 p:0006 s:0046 e:000045 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331
c:0008 p:0008 s:0040 e:000039 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26
c:0007 p:0015 s:0036 e:000035 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/list.rb:23
c:0006 p:0078 s:0031 e:000030 METHOD /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334
c:0005 p:0024 s:0024 e:000023 METHOD /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52
c:0004 p:0378 s:0019 e:000018 TOP    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC  :load
c:0002 p:0109 s:0008 E:001dc0 EVAL   /usr/local/bin/pod:23 [FINISH]
c:0001 p:0000 s:0003 E:000df0 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/pod:23:in `<main>'
/usr/local/bin/pod:23:in `load'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/list.rb:23:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:26:in `aggregate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `aggregate_with_repos'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:331:in `block in aggregate_with_repos'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:322:in `source_from_path'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/manager.rb:315:in `block in source_from_path'

*** NOTE DELETED MANY LINES AS EXCEEDED QUESTION LIMIT***

  551 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/libc.rb
  552 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/codes.rb
  553 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/options.rb
  554 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/infos.rb
  555 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/form_options.rb
  556 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/messages.rb
  557 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/functions.rb
  558 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/constants.rb
  559 /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/settings.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

[1]    13276 abort      pod list

有人知道我在 m1 上安装 cocoapods 时可能做错了什么吗?我还没有看到这是其他人的问题。 非常感谢任何帮助!

我也有同样的问题,升级ruby到3.0.3后就好了。

brew update
brew install ruby
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc

对于遇到此问题的任何其他人,我能够通过此 post

解决

https://github.com/CocoaPods/CocoaPods/issues/9890

具体通过运行以下命令 arch -x86_64 pod install 在我的终端中 运行 在 x86 上通过 Rosetta

这个问题似乎源于对 ethon 的依赖,在我执行上述操作之前它表现不佳