【问题标题】:Homebrew error while trying to install pyenv尝试安装 pyenv 时出现 Homebrew 错误
【发布时间】:2023-03-05 13:07:02
【问题描述】:

我最近通过终端安装了 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 terminal homebrew pyenv


【解决方案1】:

我也遇到了同样的问题。

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

brew doctor 的输出告诉我 homebrew/homebrew-core 没有被正确点击并推荐以下命令:

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

然后我继续使用Pyenv's installation process,一切正常。

【讨论】:

  • 使用这个rm -rf $(brew --repo homebrew/core)
最近更新 更多