美文网首页CocoaPods
CocoaPods-pod search无法正常搜索的问题与解决

CocoaPods-pod search无法正常搜索的问题与解决

作者: ruizuo007 | 来源:发表于2019-05-30 08:33 被阅读0次

问题如下所示:

$ 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]

··· 省略 ···

相关文章

网友评论

    本文标题:CocoaPods-pod search无法正常搜索的问题与解决

    本文链接:https://www.haomeiwen.com/subject/dbvytctx.html