[pod update报错(Cocoapods: Failed to connect to GitHub to update the CocoaPods/Specs specs repo)

pod update

image

[!] Failed to connect to GitHub to update the CocoaPods/Specs specs repo - Please check if you are offline, or that GitHub is down"

找了一圈资料,尝试了估计不下5种方案,最后解决记录如下:

总结起来就是:

update openssl, then ruby, then cocoapod.

一、升级openssl,先看版本

openssl version

输出:LibreSSL 1.9.8

2、输入

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

可能会要你在回车一下,点击回车键
正常输出:

image

错误提示:zsh: command not found: brew
解决方法:mac 安装homebrew,
用以下命令安装,序列号选择中科大(1)的

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

安装了还更什么新
下头有Ruby安装和pod更新爱装不装
没有事了就滚犊子!好好敲代码

3、更新brew

brew update

ps:如果提示:Error: /usr/local must be writable! 点进去查看解决步骤

4、install openssl

brew install openssl

brew upgrade openssl

5、输入

which openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

再次查看version

which openssl

输出:/usr/local/opt/openssl/bin/openssl

openssl version

输出:LibreSSL 2.8.3

二、到这里,openssl就更新完成了,下面更新ruby,输入如下:

brew install rbenv ruby-build

echo 'export PATH="PATH"' >> ~/.bash_profile

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile

source ~/.bash_profile

查看当前ruby版本:

ruby --version

输出:ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

我们需要更新到最新的版本,先查看最新版本列表

rvm list known

大概如下,能看到一片内容,找到当前最新到2.7.1


rubyList.png

输入:

rvm install 2.7

如果报错:Error running 'requirements_osx_brew_update_system ruby-2.4.1,参考:http://www.cnblogs.com/yajunLi/p/8484607.html

更新完,查看版本:

ruby --version

输出:ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

三、最后,更新cocoapods

1、先更新gem

gem install cocoapods -n /usr/local/bin

查看现在到pod版本

podVersion.png

四、最后

到这里就结束了,重启项目,新开一个终端窗口,按正常流程走,执行pod update 试试呢

O鸡巴K,散会!!我真是个垃圾

你可能感兴趣的:([pod update报错(Cocoapods: Failed to connect to GitHub to update the CocoaPods/Specs specs repo))