Cocoapods Traceback (most recent call last):...(转)

转的

原文地址原文地址原文地址原文地址原文地址原文地址原文地址

Traceback (most recent call last):
5: from /usr/local/bin/pod:23:in <main>' 4: from /usr/local/bin/pod:23:inload'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/bin/pod:55:in <top (required)>' 2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods/command.rb:49:inrun'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods/command.rb:130:in verify_minimum_git_version!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods/command.rb:118:ingit_version': Failed to extract git version from git --version ("xcrun: error: active developer path ("/Applications/Xcode11.1.app/Contents/Developer") does not exist\nUse sudo xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools, or use xcode-select --install to install the standalone command line developer tools.\nSee man xcode-select for more details.\n") (RuntimeError)

image.png

解决

1.没有安装git
可以在终端执行:xcode-select --install。如果你的电脑系统更新了,有可能这个命令解决不了你的问题,那么,这时候需要到git官网下载安装,下载链接https://git-scm.com/download/mac

2.关联路径不对
这个问题可以使用命令:sudo xcode-select --switch /Users/feiwei/Downloads/Xcode.app,其实这个命令就是指定Xcode的安装目录。如果你不知道安装路径,或者不想用命令,Xcode -->Preferences-->Locations并选择Command Line Tools,看看是否选择了当前Xcode版本。
Xcode偏好设置:


image.png
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。