小智 16
请尝试通过 brew 升级:
brew upgrade cocoapods
Run Code Online (Sandbox Code Playgroud)
sub*_*war 13
我通过在终端中使用以下命令将 ruby 更新到最新版本(3.0.0)解决了上述问题:
检查 Mac 上安装的 Ruby 版本
ruby -v
Run Code Online (Sandbox Code Playgroud)
安装 Ruby 版本管理器 rvm
curl -L https://get.rvm.io | bash -s stable
Run Code Online (Sandbox Code Playgroud)
此命令运行完毕后,您需要重新启动终端才能识别 rvm。
安装最新版本的 Ruby
rvm install ruby-[version]
Run Code Online (Sandbox Code Playgroud)
(或者)
rvm install ruby --latest
Run Code Online (Sandbox Code Playgroud)
安装 cocoapods
sudo gem install cocoapods
pod setup
Run Code Online (Sandbox Code Playgroud)