升级cocoapods问题记录

更新flutter版本后提示cocoapods需要升级

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.4 18E226, locale
    zh-Hans-CN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 10.3)
    ! CocoaPods out of date (1.6.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2017.1.4)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

直接运行提示的命令并没有升级成功

 $ brew upgrade cocoapods
 $ pod setup

改用下面方式升级

sudo gem install cocoapods
pod setup

遇到问题

$ sudo gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org/ - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

解决:国内源 https://gems.ruby-china.org/ 改为 https://gems.ruby-china.com/

# 移除源
$ gem source --remove https://gems.ruby-china.org/

#添加源
$ gem sources -a https://gems.ruby-china.com/

#查看源
$ gem sources -l
*** CURRENT SOURCES ***
https://gems.ruby-china.com/
Error fetching https://gems.ruby-china.com/:
	SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://gems.ruby-china.com/specs.4.8.gz)

ruby没有包含SSL证书,所以Https的链接被服务器拒绝。
解决:下载证书(http://curl.haxx.se/ca/cacert.pem),添加环境变量 SSL_CERT_FILE 指向文件目录。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值