1
1

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.

brew doctorをするとコマンドツールが古いとWARNINGが出た時の対処

Last updated at Posted at 2021-07-25

状況と原因

・brew doctorの照会をすると以下のWARNINGがが続出した。(当然のことながら、brewのupdateとupgradeは行った上でのこと。)
・ brew configでシステム構成を確認したところ、原因はCLT と Xcodeのバージョンが一致していないことらしいので、doctorの指示に従って 
https://developer.apple.com/download/more/.
から Xcode12.5用のコマンドラインツールをダウンロードしてみたところ表示が消えた。

ちなみに、私の場合これを行う前にdoctorの指示にある
softwareupdate --all --install —force
並びに
sudo rm -rf / Library / Developer / CommandLineTools
sudo xcode-select —install
を先に行ったが、softwareupdateでは変化なく、ターミナルからのsudo rm -rf行ったところ時間がかかった挙句、システム復元が必要になった。

「WARNINGの表示の一部」

hogehogeiMac ~ % brew doctor
Warning: Your Command Line Tools are too outdated.
Update them from Software Update in System Preferences or run:
  softwareupdate --all --install --force

If that doesn't show you any updates, run:
  sudo rm -rf /Library/Developer/CommandLineTools
  sudo xcode-select --install

Alternatively, manually download them from:
  https://developer.apple.com/download/more/.
You should download the Command Line Tools for Xcode 12.5

※ちなみに"hogehoge"は私の名前を隠しています。

これをgoogle翻訳すると

警告:コマンドラインツールが古すぎます。
システム環境設定のソフトウェアアップデートから更新するか、以下を実行します。
softwareupdate --all --install --force

それでも更新が表示されない場合は、次を実行します。
sudo rm -rf / Library / Developer / CommandLineTools
sudo xcode-select --install

または、次の場所から手動でダウンロードします。
https://developer.apple.com/download/more/.
Xcode12.5用のコマンドラインツールをダウンロードする必要があります。(Google翻訳)

という意味らしい。

この他に後2件以下のWARNINGが表示された。

WARNING: A newer Command Line Tools release is available.
	(警告:新しいコマンドラインツールリリースが利用可能です。)
WARNING: Your Command Line Tools (CLT) does not support macOS 11.
	(警告:コマンドラインツール(CLT)はmacOS11をサポートしていません。古くなっているか、変更されています)。

対処

①brew configでシステム構成を確認

hogehogeiMac ~ % brew config
HOMEBREW_VERSION: 3.2.3
ORIGIN: https://github.com/Homebrew/brew
〜〜省略〜〜
macOS: 11.5-x86_64
CLT: 11.3.0.32.62		<—Xcodeのバージョンとアンマッチの状態になっている
Xcode: 12.5.1

②下記HPへappleIDでサインインして、Xcodeと同じバージョンのコマンドラインツールをインストール(今回は:Command Line Tools for Xcode 12.5.1.dmg を選択してインストールした)
https://developer.apple.com/download/more/.
(WARNINGの中で指示あり)
スクリーンショット 2021-07-26 11.18.16.png

③ダウンロードしたコマンドラインツールのdmgを解凍後インストール

確認

brew configを実施してCLTとXcodeが一致していることを確認

hogehogeiMac ~ % brew config
HOMEBREW_VERSION: 3.2.3
ORIGIN: https://github.com/Homebrew/brew
〜〜省略〜〜
macOS: 11.5-x86_64
CLT: 12.5.1.0.1.1623191612			<—一致した!!
Xcode: 12.5.1

brew doctorを実施してみるとwarningが消えていた。

hogehogeiMac ~ % brew doctor
Your system is ready to brew.

システムを作成する準備ができました(google翻訳)

私は、この方法で正常に戻りましたが、飽くまで自己責任の下でお願いします。

参考にしたHP: https://code-graffiti.com/big-sur-and-homebrew-warning/
MacをBig SurにするとHomebrewでCLTについてのWarningが出ることへの対処法

1
1
1

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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?