尝试安装pyenv时出现Homebrew错误



我最近通过终端安装了Homebrew,但在尝试使用它安装其他程序时遇到了一些错误。

这是我尝试安装pyenv时的一个示例情况。

brew install pyenv

这是上述命令的输出:

Running `brew update --preinstall`...
Warning: No available formula with the name "ca-certificates".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> 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.
Error: 
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Error: pyenv: undefined method `cellar' for #<BottleSpecification:0x00007fd7720b4360>

我遇到了完全相同的问题。

解决我在macOS Monterey 12.1上的问题的是调查brew doctor的问题,然后按照建议的输出进行操作。

brew doctor的输出通知我,自制程序/自制程序核心没有被正确窃听,并建议使用以下命令:

rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core

然后我继续Pyenv的安装过程,一切正常。

最新更新