Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path

cocopads更新库时失败,报错Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path


最近 升级了一下电脑系统 macOSMojave 10.14.1

顺便升级了一下 Xcode Version 10.1 (10B61)

哭了 使用 cocosPods  集成时 报错

Mac:~mac$ pod-versionTraceback(most recent call last):5:from/usr/local/bin/pod:23:in`

'4:from/usr/local/bin/pod:23:in`load'3:from/Users/mac/.rvm/gems/ruby-2.5.1@global/gems/cocoapods-1.5.3/bin/pod:55:in`'2:from/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:49:in`run'1:from/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:130:in`verify_minimum_git_version!'/Users/mac/.rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in`git_version':Failedto extract git versionfrom`git--version`("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\n")(RuntimeError)

Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path_第1张图片

分析:

Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path

未能从git—version中提取 git 版本: 错误: 无效的活动开发路径;简单来说就是Git工具不好使了。

通常做法就是打开 terminal 执行 xcode-select --install

但由于我是 macOS 升级 所以这样是不行的,需要到 Git 官网下载 Git 才可以:

https://git-scm.com/download/mac

Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path_第2张图片

下载完成后手动安装 git 这样就可以解决了 !

链接:https://www.jianshu.com/p/c882c8ffa79c

------------------------------------------------------- 

!!!以上方法网慢始终下载失败,最后在终端直接打这个命令执行完安装就ok了

命令行执行: xcode-select --install解决问题 . 重要的话说三遍!!!

你可能感兴趣的:(Failed to extract git version from ' git --version ' xcrun: error: invalid active developer path)