[mac]makeコマンド実行時にエラー"xcrun: error: invalid active developer path"が出るときの対処法

カテゴリ: Mac

発生した問題

mac上でmakeコマンドを実行すると下記のようにerror: invalid active developer pathエラーが出力された

$ make
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), 
  missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

対応方法1

以下のコマンドを実行し、xcodeのインストールし直す。

$ xcode-select --install
xcode-select: note: install requested for command line developer tools

対応方法2

homebrewでmakeコマンドをインストールする。

$ brew install make

この場合、コマンドはmakeではなくgmake異コマンドとしてインストールされる。makeコマンドとして実行したい場合は、下記のように.bashrcや.zshrcなどにPATHを通すとよい。

GNU "make" has been installed as "gmake".
If you need to use it as "make", you can add a "gnubin" directory
to your PATH from your bashrc like:

    PATH="/usr/local/opt/make/libexec/gnubin:$PATH"

Amazonでおトクに買い物する方法
AmazonチャージでポイントGET


Amazonは買いもの前にAmazonギフト券をチャージしてポイントをゲットしないと損!

こちらもおススメ
カテゴリ: Mac

コメントを残す

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