Homebrewのインストール時にWarningが出る

以前にHomebrewのインストールの流れを記事で投稿しましたが、新しいMacでHomebrewのインストールをした際にうまくいかないことがあったので、その際の内容をメモしておきます。

設定方法

手順としては以前投稿した記事と同じですが、一通りの流れを行った後でもbrewコマンドを使用できませんでした。
ターミナルを確認すると、最終的に以下のようなWarningが表示されました。

Warning: /opt/homebrew/bin is not in your PATH.
  Instructions on how to configure your shell for Homebrew
  can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/XXXXX/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

「/opt/homebrew/bin」がPATHに含まれていないことが原因のようで、「Next steps:」にある2つのコマンドを実行することでPATHに追加できるようです。
記事に記載のコマンドではなく、実際にターミナルに表示されるコマンドを実行ください。

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/XXXXX/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

実際に実行してみると、brewコマンドを実行することができました。

brew doctor
このエントリーをはてなブックマークに追加

関連記事

コメントを残す

メールアドレスが公開されることはありません。
* が付いている欄は必須項目です

CAPTCHA


コメントが承認されるまで時間がかかります。

2024年4月
 123456
78910111213
14151617181920
21222324252627
282930