You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

M1芯片Macbook Pro执行pod install时出现Segmentation fault错误求助

M1芯片MacBook Pro执行pod install出现Segmentation Fault错误的解决方案

错误信息

-- Control frame information -----------------------------------------------
c:0013 p:---- s:0067 e:000066 CFUNC  :multi_perform
c:0012 p:0016 s:0061 e:000060 METHOD /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/multi/operations.rb:212
c:0011 p:0028 s:0055 e:000054 METHOD /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/multi/operations.rb:201
c:0010 p:0038 s:0049 e:000048 METHOD /Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/multi/operations.rb:50
c:0009 p:0012 s:0044 e:000043 METHOD /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/runnable.rb:15
c:0008 p:0005 s:0040 e:000039 METHOD /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus/hydra/memoizable.rb:51 [FINISH]
c:0007 p:0009 s:0036 e:000034 METHOD /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352
c:0006 p:0042 s:0027 e:000026 BLOCK  /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343 [FINISH]
c:0005 p:---- s:0021 e:000020 CFUNC  :loop
c:0004 p:0006 s:0017 e:000016 BLOCK  /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334 [FINISH]
c:0003 p:---- s:0014 e:000013 CFUNC  :catch
c:0002 p:0008 s:0009 e:000008 BLOCK  /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333 [FINISH]
c:0001 p:---- s:0003 e:000002 (none) [FINISH]

此前可正常执行pod install,本次突发该异常,以下是经过验证的解决方案:

可行方案

  • 通过Rosetta 2运行终端:
    找到启动台中的终端应用,右键选择「显示简介」,勾选「使用Rosetta打开」,重启终端后重新执行pod install。
  • 更新CocoaPods并清理缓存:
    执行命令更新CocoaPods:
    sudo gem install cocoapods
    
    清理本地Pod缓存和残留文件:
    pod cache clean --all
    rm -rf Pods/
    rm Podfile.lock
    
    之后重新执行pod install。
  • 使用ARM架构的Ruby版本:
    系统自带的Ruby 2.6.0为x86架构,在M1设备上存在兼容性问题。可以用rbenv安装适配ARM的Ruby版本:
    brew install rbenv
    rbenv install 3.2.2
    rbenv global 3.2.2
    
    重启终端后,重新安装CocoaPods并执行命令:
    gem install cocoapods
    pod install
    
  • 单独更新ethon依赖:
    错误栈指向ethon库,手动更新该依赖:
    gem update ethon
    
    完成后再次尝试pod install。

内容的提问来源于stack exchange,提问作者Kubilay Kitapcioglu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 13:26:30