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
的问题,类似443
、56
、54
,如果不能解决参考Pod\Ruby更新提示443
网友评论