mac下xcrun invalid active developer path, missing xcrun错误

在MAC下,今天要git clone一个github库下来遇到这样的一个问题:

1
2
3
4
[email protected]%git clon https://github.com/zgj0315/springbootWebService.git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
[email protected]%git clone https://github.com/zgj0315/springbootWebService.git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

google了一下,发现需要重新安装下xcode command line:
xcode-select --install 如果还没解决那么需要手动切换下xcode的路径sudo xcode-select -switch /