CocoaPods安装后出现[!] Unable to find a pod with name, author, summary, or description matching

来源:互联网 发布:淘宝小黄鸭 编辑:程序博客网 时间:2024/05/22 17:46

CocoaPods安装使用阿里ruby:
1.删除自带的ruby镜像,终端输入:

gem sources --remove https://rubygems.org/

2.添加阿里的镜像,终端输入:

gem sources -a http://rubygems-china.oss.aliyuncs.com

3.用命令查看是否修改源成功

gem sources -l

4.出现以下则成功

*** CURRENT SOURCES ***http://rubygems-china.oss.aliyuncs.com

5.安装cocoapods

sudo gem install cocoapods

6.出现以下则安装成功

27 gems installed

7.其实在你安装CocoaPods执行pod install时,系统会默认操作pod setup,然而由于中国强大的墙可能会pod setup不成功。这时就需要手动执行pod setup指令

pod setup

8.然后需要等很长时间

9.成功后执行

pod search AFNetworking

10.可能会出现

[!] Unable to find a pod with name, author, summary, or description matching `afnet`

11.pod setup成功后,依然不能pod search,是因为之前你执行pod search生成了search_index.json,此时需要删掉

rm ~/Library/Caches/CocoaPods/search_index.json

12.删除成功后,再执行

pod search afnetworking

13.输出:

Creating search index for spec repo 'master'..

14.等待成功,成功之后输出

Creating search index for spec repo 'master'.. Done!

15.然后会自动进入你搜索的第三方库。

阅读全文
0 0
原创粉丝点击