1. 程式人生 > >修復 mac os 升級後導致的xcrun: error:

修復 mac os 升級後導致的xcrun: error:

最近升級MAC OS 10.11以後,git莫名其妙的不能用了。當Git clone 一個開源專案時,提示如下錯誤:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

重新安裝一下xcode-select即可,命令如下:
xcode-select –install

之後git又可以正常工作了。
(或者不重灌,“sudo xcode-select -switch /”一下也可)。