cocoapod安装过程(一)

2016-11-22  本文已影响83人  苒妈

整个安装过程各种错误,各种折腾,整理下下次再用的时候参考下。

1.设置ruby的软件源

原ruby软件源被我朝屏蔽,需更新下ruby源。开始使用过淘宝源,总报错,后使用ruby-china成功。
'gem sources -l' (查看当前源)
'gem sources --remove #####'(移除目前源)
'gem sources -a https://gems.ruby-china.org/'(修改为ruby-china源)
'gem sources -l'

2.安装cocoapods

'sudo gem install -n /usr/local/bin cocoapods'

3.升级gem

'sudo gem update --system'

gem update

当出现RubyGems system software updated时,表示升级成功。

4.重新安装cocoapods

'sudo gem install -n /usr/local/bin cocoapods'

5.pod设置

执行命令pod setup。其实就是将https://github.com/CocoaPods/Specs.git中的Specs文件clone到.cocoapod/master中。

这一步会非常非常的慢。可以到~/.cocoapod中使用du -sh *查看下载大小。笔者发现大约600M左右。(公司这网速~一直坚持了1个小时才clone成功)


中间碰见各种错误:

DependencyError

出现上面错误DependencyError,需要升级gem版本。

升级时如果出现Errno::EPERM,表示没有权限。需使用'sudo.

sslRead() return error -36

error -9806:把vpn关掉后好用。

网上有pod repo add master https://gitcafe.com/akuandev/Specs.git修改源,但是笔者亲试总是报错[!] To setup the master specs repo, please run pod setup.
最后还是放弃,直接等龟速的pod setup。

-----------2017.3.31更新
换新电脑系统10.12.4,重新安装。
一切顺利,到pod setup报错。

PRC failed;curl 18 transfer closed with outstanding read data remaining

解决:git config --global http.postBuffer 524288000
ps 单位为b,后面那么大也就是500M。
正在等待激动的一幕,现在距离下班时间已经过去2小时。


记录下最后激动的一屏。



下篇记录创建私有库过程。

上一篇 下一篇

猜你喜欢

热点阅读