Magic:stock zhoujun$ brew install gcc
Updating Homebrew...
Warning: Building gcc from source:
The bottle needs the Xcode CLT to be installed.
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: gcc cannot be built with any available compilers.
Install GNU's GCC
brew install gcc
此时执行
xcode-select --install
按照提示安装就可以
值得注意的是如果网络很不好,那么有可能会提示安装失败或者找不到软件