gitクローンできなくなってしなった。

環境

  • mac high sierra 10.13.6

git使おうとしたらこのようなエラーがでるようになってしまいました。

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

でも、ターミナル上でxcode-selectはすでにあるよ?

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

パスを直さなきゃいけなかった。

xcode-select -pを実行。下記のようになるはず。パスがおかしいので直す。

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

下記のコマンドを実行

sudo xcode-select -switch 

パスが正しいものになってるはず。gitが使えるはず。

$ xcode-select -p
/Library/Developer/CommandLineTools
藤沢瞭介(Ryosuke Hujisawa)
  • りょすけと申します。18歳からプログラミングをはじめ、今はフロントエンドでReactを書いたり、AIの勉強を頑張っています。off.tokyoでは、ハイテクやガジェット、それからプログラミングに関する情報まで、エンジニアに役立つ情報を日々発信しています!

未整理記事