美文网首页iOS大咖说
iOS pod install失败,提示CocoaPods co

iOS pod install失败,提示CocoaPods co

作者: 宥落 | 来源:发表于2021-01-26 14:11 被阅读0次

1.pod install失败

在执行pod install的时候会失败,提示如下:

[!] CocoaPods could not find compatible versions for pod "MJRefresh":
  In Podfile:
    MJRefresh (~> 3.5.0)

None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

按提示执行pod install --repo-update之后,还是失败,提示:

[!] CocoaPods could not find compatible versions for pod "MJRefresh":
  In Podfile:
    MJRefresh (~> 3.5.0)

None of your spec sources contain a spec satisfying the dependency: `MJRefresh (~> 3.5.0)`.

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

两者的都是由于本地索引库没有更新到最新,找不到对应版本的spec文件,按如下方法执行:

// 以本地master的实际目录为准:
cd ~/.cocoapods/repos/master
Git pull

执行完这两个命令之后,再执行pod install即可,参考

不过以上方法可能比较耗时,并且下载了很长时间也会失败,这里推荐你使用第三步中的方法,方便不耗时!

2.cocoapods升级

执行:

sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods

3.SSL_ERROR_SYSCALL

提示:

error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

主要是cocoapods下载spec文件的速度太慢,个人喜欢到下面的地址直接下载,即Podfile文件的引入源。

https://github.com/CocoaPods/Specs.git

解压完成之后将文件命名为master, 然后打开~/.cocoapods/repos/删除repos文件下的master,将我们下载的master文件替换进来,打开终端执行:

pod setup

完成之后,就可以正常执行pod install操作了。以上方法也可以解决部分SSL_ERROR_SYSCALL的问题,类似4435654,如果不能解决参考Pod\Ruby更新提示443

相关文章

网友评论

    本文标题:iOS pod install失败,提示CocoaPods co

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