我安装cocoapods爬过的路和坑
2017-08-25 本文已影响0人
武个武6个武
1.设置ruby的软件源
现在设置天朝的源
gem sources -l #(查看当前ruby的源)
gem sources --remove https://rubygems.org/ #(移除当前ruby的源)
gem sources -a https://ruby.taobao.org/ #(设置当前ruby的源为我天朝的)
gem sources -l #(再次查看当前ruby的源)
出现如图所示的就说明成功了

天真的我觉得so easy 然后就$ sudo gem install cocoapods 真是图样图森破再然后就
坑1:ERROR: SSL verification error at depth 1: 巴拉巴拉 如图

然后找了度娘(http://blog.csdn.net/ios_xumin/article/details/76732271)和亲测后可以
1.安装Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.安装rvm
curl -L get.rvm.io | bash -s stable

3.装载rvm 4.安装2.3.0版本ruby
source ~/.rvm/scripts/rvm
rvm install 2.3.0

就这样遇到了###坑2:Requirements installation failed with status: 1.

看到有人说接下来在终端输入
rvm get head
就可以 但是在这之前我手快的又来了一遍步骤4 rvm install 2.3.0 然后就可以了 所以不知道 rvm get head 好使不。。
5.将2.3.0设为默认
rvm use 2.3.0 --default

然后就可以愉快的下载和安装CocoaPods
sudo gem install cocoapods
输入密码之后

就在我试着pod search SDWebImage 叕报错!!
[!] Unable to find a pod with name, author, summary, or description matching SDWebImage
然后输入
rm ~/Library/Caches/CocoaPods/search_index.json
即可 哦了~到此结束