CocoaPods最新版本升级

升级CocoaPods的步骤和安装的时候差不多,具体参考如下步骤:

1. 首先我们可以查看下当前的版本号命令如下:

pod --version

1.2.0 // 本机安装的版本
复制代码

2. 在升级之前我们需要了解当前安装的Ruby源地址:

gem source -l

*** CURRENT SOURCES ***

http://rubygems.org/
https://gems.ruby-china.org/
https://ruby.taobao.org/
复制代码

上面我已经添加过新的源

3. 移除淘宝的Ruby源,添加一个新的源(注意:目前淘宝的源已经不能用了)

// 移除旧的源
gem sources --remove https://ruby.taobao.org/
https://ruby.taobao.org/ removed from sources

// 添加新的源
gem sources -a https://gems.ruby-china.org/
// 因为已经添加过了
source https://gems.ruby-china.org/ already present in the cache
复制代码

4. 查看新的源是否添加成功,使用的命令和步骤2一样

gem source -l

*** CURRENT SOURCES ***

https://gems.ruby-china.org/
复制代码

5. 开始安装,输入如下命令:

sudo gem install cocoapods

Password:
Fetching: cocoapods-core-1.5.0.gem (100%)
Successfully installed cocoapods-core-1.5.0
Fetching: claide-1.0.2.gem (100%)
Successfully installed claide-1.0.2
Fetching: cocoapods-deintegrate-1.0.2.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.2
Fetching: cocoapods-downloader-1.2.0.gem (100%)
Successfully installed cocoapods-downloader-1.2.0
Fetching: netrc-0.11.0.gem (100%)
Successfully installed netrc-0.11.0
Fetching: cocoapods-trunk-1.3.0.gem (100%)
Successfully installed cocoapods-trunk-1.3.0
Fetching: molinillo-0.6.5.gem (100%)
Successfully installed molinillo-0.6.5
Fetching: atomos-0.1.2.gem (100%)
Successfully installed atomos-0.1.2
Fetching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: nanaimo-0.2.5.gem (100%)
Successfully installed nanaimo-0.2.5
Fetching: xcodeproj-1.5.7.gem (100%)
Successfully installed xcodeproj-1.5.7
Fetching: ruby-macho-1.1.0.gem (100%)
Successfully installed ruby-macho-1.1.0
Fetching: cocoapods-1.5.0.gem (100%)
Successfully installed cocoapods-1.5.0
Parsing documentation for cocoapods-core-1.5.0
Installing ri documentation for cocoapods-core-1.5.0
Parsing documentation for claide-1.0.2
Installing ri documentation for claide-1.0.2
Parsing documentation for cocoapods-deintegrate-1.0.2
Installing ri documentation for cocoapods-deintegrate-1.0.2
Parsing documentation for cocoapods-downloader-1.2.0
Installing ri documentation for cocoapods-downloader-1.2.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.3.0
Installing ri documentation for cocoapods-trunk-1.3.0
Parsing documentation for molinillo-0.6.5
Installing ri documentation for molinillo-0.6.5
Parsing documentation for atomos-0.1.2
Installing ri documentation for atomos-0.1.2
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for nanaimo-0.2.5
Installing ri documentation for nanaimo-0.2.5
Parsing documentation for xcodeproj-1.5.7
Installing ri documentation for xcodeproj-1.5.7
Parsing documentation for ruby-macho-1.1.0
Installing ri documentation for ruby-macho-1.1.0
Parsing documentation for cocoapods-1.5.0
Installing ri documentation for cocoapods-1.5.0
Done installing documentation for cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, netrc, cocoapods-trunk, molinillo, atomos, colored2, nanaimo, xcodeproj, ruby-macho, cocoapods after 9 seconds
13 gems installed
复制代码

报错:

  • Operation not permitted - /usr/bin/xcodeproj

    解决办法:sudo gem install -n /usr/local/bin cocoapods
    复制代码
  • While executing gem ... (TypeError) no implicit conversion of nil into String

    // 解决办法是执行如下命令更新gem
    sudo gem update --system
    复制代码

6. 再次查看下CocoaPods的版本,已经成功升级咯!

pod --version

1.5.0
复制代码
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值