1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacOSのアップデートでHomebrewがOS Version Errorを吐いた

Last updated at Posted at 2022-04-12

環境:
MacOS Catalina→Monterey
bash 5.1.8

OSをMontereyにアップデートし、ターミナルを起動したらHomebrewがエラーを吐いた。

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:32:in `from_symbol'
	 1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:32:in `fetch'
/usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:32:in `block in from_symbol': unknown or unsupported macOS version: :dunno (MacOSVersionError)

下記で解決した。

$ brew update-reset

公式ドキュメントによると
brew(1) – The Missing Package Manager for macOS (or Linux) — Homebrew Documentation

update-reset [repository …]
Fetch and reset Homebrew and all tap repositories (or any specified repository) using git(1) to their latest origin/HEAD.

Note: this will destroy all your uncommitted or committed changes.

gitを使用し、Homebrewと全てのタップリポジトリ(または指定のリポジトリ)を最新のorigin/HEADにフェッチ・リセットする。

注意:未コミットやコミット済みの変更を全て破棄する。

コマンドでリポジトリを指定しなければ、GitHubからHomebrewとタップリポジトリの最新版(origin/HEAD)を取ってきます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?