0
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.

laravelコマンドが呼び出せないと思ったらデフォルトログインシェルが変わっていた

Last updated at Posted at 2021-07-02

準備

composerとLaravelはインストール済み。
.bash_profileにも以下の内容を書き込んだ。

export PATH=$HOME/.composer/vendor/bin:$PATH

.bash_profileを読み込ませるために以下を実行。

source ~/.bash_profile

これでlaravelが呼べるようになる

laravel -V
Laravel Installer 4.2.7

ここまでは良かった。

ターミナルを再起動するとlaravelが呼べなくなる

ターミナルを再起動して以下のコマンドを実行。

laravel -V
zsh: command not found: laravel

コマンドが見つからない?

原因

MacOS Catalia以降は.bash_profileが読み込まれないらしい。
読み込まれないならそりゃ呼べないよね…。

詳細

原因を調べるうちに見つけたブログです。
詳しくはそちらを読んでください。
MacOS Catalinaはデフォルトのログインシェルがbashではないらしい。

解決

先に用意していた.bash_profileを読み込まれるファイル名にリネームしただけ。

mv .bash_profile .zprofile

これでターミナル再起動後もlaravelが有効になりました。

laravel -V
Laravel Installer 4.2.7
0
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
0
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?