如何使用brew更新cocoapod版本

mef*_*man 2 homebrew cocoapods

我已经通过此安装了cocoapods - https://apple.stackexchange.com/questions/418222/installing-cocoapods-to-macos-catalina/418230#418230

它安装了cocoapods v1.5.2。现在我想更新版本到最新的v1.10.0。

所以我用过——

brew upgrade cocoapods
Run Code Online (Sandbox Code Playgroud)

我也尝试过这个 -

brew install cocoapods@1.10.0
Run Code Online (Sandbox Code Playgroud)

但我越来越-

Error: This command updates brew itself, and does not take formula names.
Use `brew upgrade cocoapods` instead.
Fahims-Mac-mini:~ fahimrahman$ brew upgrade cocoapods
Fahims-Mac-mini:~ fahimrahman$ brew upgrade cocoapods
Fahims-Mac-mini:~ fahimrahman$ brew install cocoapods@1.10.0
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask with the name "cocoapods@1.10.0".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
Run Code Online (Sandbox Code Playgroud)

也尝试过这个 -

sudo gem install cocoapods 
Run Code Online (Sandbox Code Playgroud)

但仍然无法在我的设备上运行。那么如何使用brew更新cocoapods版本呢?

小智 6

我有同样的问题并解决了。这让我很烦恼,因为在网站https://formulae.brew.sh/formula/cocoapods中最新的稳定版是 1.10.1 但仍然用brew 安装了 me1.5.4

通过使用找出问题 brew doctor

我收到以下警告。某些 Tap 不在默认 git origin 分支上,可能无法接收更新。如果这让您感到惊讶,请使用以下命令检查默认分支: git -C $(brew --repo homebrew/core) checkout master

然后,按照建议,我就这么做了。(为您解决相关问题)

git -C $(brew --repo homebrew/core) 然后,brew install cocoapods为我安装了最新版本。希望能解决。