macos - 尝试安装 pyenv 时出现 Homebrew 错误

标签 macos terminal homebrew pyenv

我最近通过终端安装了 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 的输出告诉我 homebrew/homebrew-core 没有被正确地挖掘并推荐以下命令:

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

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

关于macos - 尝试安装 pyenv 时出现 Homebrew 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70583637/

相关文章:

macos - 在 macOS Sierra 上安装 Rust 时无法写入 .bash_profile

python - 在 Homebrew Python 2.7 安装中升级 pip 的问题

ruby-on-rails - 如何在错误 rails "warning: 299 Elasticsearch built-in security features are not enabled. Without authentication, your cluster could..."中修复此问题

macos - MariaDB Homebrew 安装错误

macos - 如何更改 Qt Creator 中的终端?

macos - 无法激活 MacPorts 安装的 Zsh

xcode - 每个 Nib 使用 1 个 Controller 转换新 xcode cocoa 项目的步骤

php - 在 Mac Mavericks 上停止内置的 php 服务器 - Livecode

terminal - 在 RubyMine 中打开时如何更改终端字体?

c - 是否有可以像终端一样显示文本的 Gtk3 Widget?