“pod init”创建错误,说“你需要至少git版本1.8.5才能使用CocoaPods” [英] "pod init" creates error that says "You need at least git version 1.8.5 to use CocoaPods"

查看:643
本文介绍了“pod init”创建错误,说“你需要至少git版本1.8.5才能使用CocoaPods”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在我的系统中安装任何pod。
因此,我从Mac上移除了cocoapods,然后重新安装了它。
该过程成功但当我运行命令 pod init 以下错误显示在终端中时:

I was not able to install any pod in my system. Hence, I removed cocoapods from my Mac and then reinstalled it. The process was successful but when I run the command pod init following error shows up in the terminal:

`verify_minimum_git_version!': [!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:49:in `run'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'

我还检查了我的Git版本是1.8.4但是我得到任何解决方案来更新它。

I also checked my Git version which was 1.8.4 but I am getting any solution to update the same.

推荐答案

首先使用命令删除系统中现有的git: -

Firstly remove the existing git in your system using commands:-

使用命令which git
将给你的路径说/ usr / local / bin / git,然后使用命令 - > $ sudo rm -rf / usr / local / bin / git

Use command "which git" that will give u the path say "/usr/local/bin/git", then use command->$ sudo rm -rf /usr/local/bin/git

这将删除你现有的git系统
然后重新安装git

This will remove existing git from your system Then reinstall git again

$ brew install git

它可能会发出警告说

警告:已经安装了git 2.13.2,它只是没有链接。
您可以使用`brew link git`链接此版本。

然后运行下面提到的命令: -

Then run below mentioned command:-

$ sudo chown -R $(whoami) /usr/local/share/
$ sudo chown -R $(whoami) /usr/local/lib
$ brew link --overwrite --dry-run git

它可能会给你错误

错误:无法符号链接share / git-core / templates / description
目标/ usr / local / share / git-core / templates / description
已存在。您可能想删除它:
rm'/ usr / local / share / git-core / templates / description'

强制链接并覆盖所有冲突的文件:
brew link --overwrite git

To force the link and overwrite all conflicting files: brew link --overwrite git

列出所有要删除的文件:
brew link --overwrite --dry-run git

To list all files that would be deleted: brew link --overwrite --dry-run git

然后最后运行命令

$ brew link --overwrite git

这是我更新我的git和pod init工作。希望你觉得它有用:)

This is how I updated my git and pod init worked. Hope you find it helpful :)

这篇关于“pod init”创建错误,说“你需要至少git版本1.8.5才能使用CocoaPods”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆