开始安装
1 安装需要⽤到Ruby,虽然Mac⾃带了Ruby,不过版本有点⽼了,最好更新⼀下
sudo gem update --system
2 接下来输⼊系统密码就可以安装了,输⼊密码时不会显⽰的,输完回车就⾏了
3 因为Ruby的软件源rubygems.org被屏蔽了,所以要更换源
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
4 接下来查看下源路径是否更换了
gem sources -l
5 接下来安装Cocoapods了
sudo gem install cocoapods
6 不过有可能出错(我就是出错了),出错的话执⾏下⾯的命令
sudo gem install -n /usr/local/bin cocoapods
7 安装cocospod
pod setup
下载完就⼤功告成了(没有⽹络问题就可以开始使⽤了). 如果失败继续下⼀种⽅案
8 如果是下⾯的错误,说明⽹络导致下载时间⾮常长,所以,你可以在
sudo gem install -n /usr/local/bin cocoapods
命令后直接执⾏
git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
该过程作⽤与 pod setup作⽤相同,效果极佳!!!!
error: RPC failed; curl18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF9 如果是下⾯的错误,解决⽅法是:
git config –global http.postBuffer 524288000(尽量⼤)
是postBuffer 默认值较⼩的原因,配置⼀个⼤⼀点的值)
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
来源:oschina
链接:https://my.oschina.net/u/4278651/blog/3227788