4
4

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 1 year has passed since last update.

【Homebrew】インストールしてるのにbrewが見つからない

Last updated at Posted at 2023-04-09

はじめに

間違った手順

Homebrewをインストールします

ターミナル
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Homebrewのパスを通します

ターミナル
export PATH="$PATH:/opt/homebrew/bin"

実行できました

ターミナル
brew -v

→ Homebrew 4.0.11

しかし、ターミナルを再起動すると。。。

ターミナル
brew -v

→ zsh: command not found: brew

正しい手順

Homebrewをインストールします

ターミナル
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

.zprofileを作成します

ターミナル
touch .zprofile

.zprofileを開きます

ターミナル
open .zprofile

.zprofileに以下をコピペします

.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

.zprofileを読み込みます

ターミナル
source ~/.zprofile

実行できました

ターミナル
brew -v

→ Homebrew 4.0.11

ターミナルを再起動してもパスが通ってる!!

ターミナル
brew -v

→ Homebrew 4.0.11

おわり

Homebrewでインストールするものは多いのできちんと設定しておきたいです。

4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?