cocoapods 更新遇到SSLError问题

发布于 2022-09-02 09:55:56 字数 5734 浏览 14 评论 0

在项目目录中执行pod install后,遇到OpenSSL::SSL::SSLError - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A错误。

Google了各种方法,始终没能解决这个问题。
所以就尝试了把cocoapods更新到1.0.0-beta4版本,然而问题依旧。

cocoapods的完整输出如下:

Command

/usr/local/bin/pod install

Report

  • What did you do?

  • What did you expect to happen?

  • What happened instead?

Stack

   CocoaPods : 0.39.0
        Ruby : ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
    RubyGems : 2.0.14
        Host : Mac OS X 10.11.3 (15D21)
       Xcode : 7.2.1 (7C1002)
         Git : git version 2.5.4 (Apple Git-61)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://gitcafe.com/akuandev/Specs.git @ cf02a93f9c0189ec3343103a068d45c2c60780fc
               master-1 - https://github.com/CocoaPods/Specs.git @ 7842de006bbab20edac067bc8a768049c61ec472

Plugins

cocoapods-plugins : 0.4.2
cocoapods-search  : 0.1.0
cocoapods-stats   : 0.6.2
cocoapods-trunk   : 0.6.4
cocoapods-try     : 0.5.1

Podfile

platform :ios, '7.0'
pod "AFNetworking", '~> 2.6.3'
pod "MWFeedParser"
pod 'MBProgressHUD', '~> 0.8'
pod 'Evernote-SDK-iOS', '~> 1.3.1'
pod 'ViewUtils'
pod 'MMLayershots', :podspec => 'https://raw.githubusercontent.com/vpdn/MMLayershots/master/MMLayershots.podspec'
pod 'RMSwipeTableViewCell'
pod 'RETableViewManager', '~> 1.5.10'
pod 'PAPreferences'
pod 'SDWebImage'
pod 'Masonry'
pod 'MJRefresh'
pod 'JSONModel'
pod 'Reveal-iOS-SDK', :configurations => ['Debug']

Error

OpenSSL::SSL::SSLError - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:921:in `connect'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:921:in `block in connect'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:921:in `connect'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:313:in `open_http'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:709:in `buffer_open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:210:in `block in open_loop'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:in `open_loop'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:149:in `open_uri'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:689:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:34:in `open'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/external_sources/podspec_source.rb:19:in `block in fetch'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:80:in `titled_section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/external_sources/podspec_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:457:in `fetch_external_source'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:434:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:433:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:433:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:432:in `fetch_external_sources'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer/analyzer.rb:69:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:213:in `analyze'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:136:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:135:in `resolve_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:105:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:71:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:101:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.39.0/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

gem用的是淘宝的源。

Update

问题已经解决。问题处在Podfile中,将Podfilepod 'MMLayershots', :podspec => 'https://raw.githubusercontent.com/vpdn/MMLayershots/master/MMLayershots.podspec'这行代码从逗号往后的内容去掉就解决了。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

等待我真够勒 2022-09-09 09:55:56

用的淘宝的源是 https://ruby.taobao.org/ 吗?

奢望 2022-09-09 09:55:56

这个好像是很久以前的问题,报错跟你这个差不多,不过已经被close了,你可以看看这个https://github.com/CocoaPods/CocoaPods/pull/2073

报错SSL的话先确定一下有没有使用代理。

再不行可以试试把CocoaPods装在用户目录下(来自官方文档免sudo安装),保持之前设置好的淘宝源:

  • 将下面配置加入~/.bashrc(如果你用的是bash)

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
  • 安装

gem install cocoapods --user-install

这样做不一定有效,但是可以测试一下是不是因为CocoaPods没安装好引起的问题。另外CocoaPods上次升级,对Podfile进行了更严格的检验,也可能导致update出错的原因。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文