问题描述
在一个仓库下执行 bundler 后,想使用 bundle exec pod install
却发生以下错误
c:0036 p:---- s:0193 e:000192 CFUNC :attach
c:0035 p:0258 s:0187 e:000186 METHOD /Users/bd/.bundle/vendor/ruby/2.6.0/gems/ffi-1.15.0/lib/ffi/library.rb:275
c:0034 p:0050 s:0167 e:000166 CLASS /Users/bd/.bundle/vendor/ruby/2.6.0/gems/ethon-0.12.0/lib/ethon/libc.rb:16
c:0033 p:0007 s:0164 e:000163 CLASS /Users/bd/.bundle/vendor/ruby/2.6.0/gems/ethon-0.12.0/lib/ethon/libc.rb:6
c:0032 p:0007 s:0161 e:000160 TOP /Users/bd/.bundle/vendor/ruby/2.6.0/gems/ethon-0.12.0/lib/ethon/libc.rb:1 [FINISH]
c:0031 p:---- s:0158 e:000157 CFUNC :require
c:0030 p:0042 s:0153 e:000152 TOP /Users/bd/.bundle/vendor/ruby/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:14 [FINISH]
c:0029 p:---- s:0150 e:000149 CFUNC :require
...
使用 ➜ ~ ruby -v ruby 查看本地ruby版本
2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
解决方案
切换新版2.7.3版本ruby
curl -sSL https://get.rvm.io | bash -s stable # Install rvm
rvm install 2.7.3 # Install ruby 2.7.3
rvm use 2.7.3 --default # Switch the default version of ruby to 2.7.3