问题如下所示:
$ pod search YTKNetwork
··· 省略 ···
[!] Unable to find a pod with name, author, summary, or description
matching `YTKNetwork`
首先需要尝试执行pod setup
。其实在你安装CocoaPods
执行pod install
时,系统会默认操作pod setup
,然而由于网络等因素可能会导致pod setup
失败。具体如下所示:
$ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git -C /Users/yourname/.cocoapods/repos/master fetch origin
--progress
remote: Enumerating objects: 101, done.
remote: Counting objects: 100% (101/101), done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 72 (delta 45), reused 49 (delta 27), pack-reused 0
From https://github.com/CocoaPods/Specs
0d85aa8d9fa..6150d0e7ef2 master -> origin/master
$ /usr/bin/git -C /Users/yourname/.cocoapods/repos/master rev-parse
--abbrev-ref HEAD
master
$ /usr/bin/git -C /Users/yourname/.cocoapods/repos/master reset --hard
origin/master
HEAD is now at 6150d0e7ef2 [Add] ABN_PolyvBusinessSDK 0.7.2
Setup completed
如果pod search
操作继续失败。这个时候需要删除 ~/Library/Caches/CocoaPods
目录下的search_index.json
文件。pod setup
成功后,依然不能正常pod search
是因为之前你执行pod search
已经生成了search_index.json
文件,此时需要删掉。如下所示:
$ rm -rf ~/Library/Caches/CocoaPods/search_index.json
删除成功后,继续执行pod search
成功。如下所示:
$ pod search YTKNetwork
Creating search index for spec repo 'master'.. Done!
-> YTKNetwork (2.0.4)
YTKNetwork is a high level request util based on AFNetworking.
pod 'YTKNetwork', '~> 2.0.4'
- Homepage: https://github.com/yuantiku/YTKNetwork
- Source: https://github.com/yuantiku/YTKNetwork.git
- Versions: 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.3.0, 1.2.0, 1.1.0, 1.0.0,
0.6.0, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.0 [master repo]
··· 省略 ···
网友评论