更新 cocoapods 出现如下错误:

Posted ZCLegendary

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更新 cocoapods 出现如下错误:相关的知识,希望对你有一定的参考价值。

刚刚升级了系统跟 Xcode, 更新 cocoapods 时出现了以下报错:

[zhangchangdeMBP:~ rongtaixingzhuo$ pod --version

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:118:in `git_version': Failed to extract git version from `git --version` ("xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun\\n") (RuntimeError)

from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:130:in `verify_minimum_git_version!'

from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:49:in `run'

from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'

from /usr/local/bin/pod:23:in `load'

from /usr/local/bin/pod:23:in `<main>'

 

解决方式:

命令行执行: xcode-select --install

以上是关于更新 cocoapods 出现如下错误:的主要内容,如果未能解决你的问题,请参考以下文章

填坑系列之更新CocoaPods

添加 watchkit 时带有 cocoapods 的 Swift 项目出现新错误

CocoaPods 找不到 pod“Capacitor”的兼容版本

Cocoapods 出现问题,在安装 pod 时显示错误“无法确定 URL 的 repo 类型”

iOS更新 CocoaPods 后 Podfile 报错

Cocoapods 0.39.0 更新错误