2018 11 05
最近 升级了一下电脑系统 macOSMojave 10.14.1
顺便升级了一下 Xcode Version 10.1 (10B61)
哭了 使用 cocosPods 集成时 报错
Mac:~ mac$ pod -version
Traceback (most recent call last):
5: from /usr/local/bin/pod:23:in `<main>'
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 `<top (required)>'
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': 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)
分析:
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
下载完成后手动安装 git 这样就可以解决了 !