MAC 升级到10.14 mojave beta之后git无法使用解决方案

MAC 升级到10.14 mojave之后git无法使用解决方案

这几天google用不了只能靠百度了,首先查到原因是因为每次大版本升级之后,xcode会被卸载,而我本来就没有想xcode,又了解了一下,不是xcode而是CommandLineTools,跟xcode有一定关系,git这种命令行工具依赖于CommandLineTools。
于是按照教程执行
`xcode-select --install
然而安装的时候提示服务器上找不到软件,这beta版还真是够beta的。
继续百度,找到一博客说重新安装最新版xcode(上面一条命令安装的时候是会弹出安装xcode的选项的),于是乎安装xcode,居然有5个多G,安装好之后再执行上面命令,依然不行。
本来打算放弃,等更新的,后来实在不方便又搜了一下,想看看能不能手动安装CommandLineTools,然后在V2EX上找到一句有用的话
安装 brew 后执行 brew doctor 命令后会自动提示你安装的
执行brew doctor之后果然出来很多warning,截取其中一段

Warning: Xcode alone is not sufficient on Dunno.
Install the Command Line Tools:
  xcode-select --install


Warning: Ruby version 2.3.6 is unsupported on 10.14. Homebrew
is developed and tested on Ruby 2.3.3, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.

Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path:
  sudo xcode-select -switch /Applications/Xcode.app

其中的sudo xcode-select -switch /Applications/Xcode.app命令看起来像是这个问题的解决方案,执行之后果然git恢复了,找时间再把臃肿的xcode卸载掉

猜你喜欢

转载自blog.csdn.net/huyuan7494/article/details/80621547