mac更新后git不可用

让人想犯罪 __ 提交于 2019-12-11 01:35:28

更新后报错

错误提示如下:

dyld: Library not loaded: @rpath/libswiftCore.dylib
  Referenced from: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
  Reason: image not found
git: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
git: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

查找解决方案

网上查到输入下面的命令

sudo xcode-select --switch /Library/Developer/CommandLineTools/

仍然报错:

xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/'

安装xcode-select

xcode-select --install

根据提示的弹框安装xcode-select
再次执行如下命令

sudo xcode-select --switch /Library/Developer/CommandLineTools/

执行完不报错,ok

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!