一、git clone方法安装cocoapods
1. 进入目录
$ cd ~/.cocopods/repos
2.$ sudo gem install cocopods(苹果系统升级 OS X EL Capitan 后改为 $sudo gem install -n /usr/local/bin cocoapods
)
3.克隆一个Specs库,在终端必须进入到~/.cocoapods/repos的目录才执行以下命令。
$ git clone https://github.com/CocoPods/Specs(备注:如果上面那个龟速的话,可以尝试下这个git clone https://git.coding.net/CocoaPods/Specs.git,安装期间出现了几次类似于这个错误The remote end hung up unexpectedly87.85 MiB | 123.00 KiB/s,自己的解决办法是--多clone了几次,然后就成功了
).
4.完成后,执行open .打开当前目录repos
$ open .
5.在~/.cocoapods/repos的目录下把Specs目录改名为master即可。