升级macOS Mojave后pod失效问题解决

升级macOS Mojave后pod失效

系统升级到10.14后,pod使用失效,报错:

/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 `'
   from /usr/local/bin/pod:22:in `load'
   from /usr/local/bin/pod:22:in `
'

提示:git --version找不到git的版本

我们只要安装git即可:
常规安装:xcode-select --install
升级系统需要手动安装git:从官网下载,完成后点击安装,pod就可以正常使用了。

cocoapods版本更新

  1. sudo gem install cocoapods --pre
  2. 发生错误时使用:
    sudo gem install -n /usr/local/bin cocoapods --pre

gem版本更新

sudo gem update --system

你可能感兴趣的:(开发工具)