本文主要是介绍【Mac】升级到 Monterey brew 报错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
目录
一. 问题
二. 解决
三. 参考
一. 问题
升级系统后,使用 brew, 报错如下:
$ brew
Traceback (most recent call last):11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:in `<main>'10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:31:in `require_relative'9: from /usr/local/Homebrew/Library/Homebrew/global.rb:80:in `<top (required)>'8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'6: from /usr/local/Homebrew/Library/Homebrew/os.rb:7:in `<top (required)>'5: from /usr/local/Homebrew/Library/Homebrew/os.rb:43:in `<module:OS>'4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:60:in `prerelease?'3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:28:in `version'2: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:in `from_symbol'1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:in `fetch'
/usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:33:in `block in from_symbol': unknown or unsupported macOS version: :dunno (MacOSVersionError)
二. 解决
参考如下链接, https://github.com/Homebrew/brew/issues/11668#issuecomment-875631258https://github.com/Homebrew/brew/issues/11668#issuecomment-875631258
给出如下信息:
==> You are using macOS 12.0.
==> We do not provide support for this pre-release version.
不提供对预发布版本的支持 !!!
然后找到如下链接,
os/mac: fix version error for prerelease macOS by Bo98 · Pull Request #10717 · Homebrew/brew · GitHub
后来Homebrew 又修复支持了。
由于本人用如下脚本(~/.bash_profile)屏蔽了brew 的每次更新操作:
# Homebrew Settings
export PATH="$PATH:$HOME/.rvm/bin"
export HOMEBREW_NO_AUTO_UPDATE=true
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
那更新一下就好了吧?
使用如下办法:
$ brew update-reset==> Fetching /usr/local/Homebrew...
remote: Enumerating objects: 25167, done.
remote: Counting objects: 100% (6678/6678), done.
remote: Compressing objects: 100% (339/339), done.
remote: Total 25167 (delta 6357), reused 6602 (delta 6308), pack-reused 18489
Receiving objects: 100% (25167/25167), 9.96 MiB | 4.80 MiB/s, done.
Resolving deltas: 100% (17778/17778), completed with 984 local objects.
From https://github.com/Homebrew/brewf416f8b54..3f0b41295 master -> origin/master...==> Resetting /usr/local/Homebrew...
Branch 'master' set up to track remote branch 'master' from 'origin'.
Reset branch 'master'
Your branch is up to date with 'origin/master'.==> Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask......
然后等吧,等个好长时间,不行的话,不得不f墙。
三. 参考
- macOS(或 Linux)缺失的软件包的管理器 — Homebrew
- https://github.com/Homebrew/brew/issues/11668#issuecomment-875631258
- os/mac: fix version error for prerelease macOS by Bo98 · Pull Request #10717 · Homebrew/brew · GitHub
- homebrew | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
这篇关于【Mac】升级到 Monterey brew 报错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!