2019独角兽企业重金招聘Python工程师标准>>>
1.安装rvm
curl -L get.rvm.io | bash -s stable
2.列出出可用的ruby版本
rvm list known
3.更新最新版ruby,我看到能用的最新版为2.4.1
rvm install 2.5.1
4.找出目前版本的pod路径
which pod
5.移除现有pod
rm -rf /usr/local/bin/pod
6.重新下载pod
sudo gem install cocoapods
安装 Cocoapods 的时候出现
Error fetching https://ruby.taobao.org/:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://ruby.taobao.org/specs.4.8.gz)
即将 gem sources -a https://ruby.taobao.org/
换成
gem sources -a https://gems.ruby-china.com
1、查看当前ruby源
gem sources -l
1
2、移除(所有)ruby源
gem sources --remove https://rubygems.org/
1
3、添加新的ruby源
gem sources -a http://gems.ruby-china.com/
1
pod search AFNetworking 出现错误
[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`
执行 pod setup
其实在你安装 CocoaPods 执行 pod install
时,系统会默认操作 pod setup
,然而由于墙可能会 pod setup
不成功。这时就需要手动执行 pod setup
指令,如下:
pod setup
如果还不行
删除 ~/Library/Caches/CocoaPods 目录下的 search_index.json 文件 pod setup
成功后,依然不能 pod search
是因为之前你执行 pod search
生成了 search_index.json 此时需要删掉。
rm ~/Library/Caches/CocoaPods/search_index.json