CocoaPods 升级到1.1.0 beta 后无法使用新版本

20160929

前几天升级Xcode 8后,之前用Swfit2.2开发项目无法编译了,需要把代码转成Swift3.0,试了好几次Xcode Edit菜单中的Convert功能,前几次在转换语法的时候Xcode都奔溃了,后来则一直等待,最长一次等了一个多小时还是没反应,最终放弃了。

问题主要出在第3方开源框架的语法转换上,所以打算把它们都删除之后,重新下载支持Swift3.0的版本。但是发现我的1.0.1版本的CocoaPods做不到,比如Alamofire 4.0的Readme.md文档中明确要求要1.1.0以上的CocoaPods才行。

所以就去更新CocoaPods,首先想到的是:

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

结果提示如下:

ERROR:  Could not find a valid gem 'cocoapods' (= 1.1.0) in any repository
ERROR:  Possible alternatives: cocoapods

所以我想可能是CocoaPods还没更新到1.1.0正式版,因此又:

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

结果提示如下:

Fetching: gh_inspector-1.0.2.gem (100%)
Successfully installed gh_inspector-1.0.2
Fetching: fourflusher-1.0.1.gem (100%)
Successfully installed fourflusher-1.0.1
Fetching: xcodeproj-1.3.0.gem (100%)
Successfully installed xcodeproj-1.3.0
Fetching: molinillo-0.5.0.gem (100%)
Successfully installed molinillo-0.5.0
Fetching: cocoapods-downloader-1.1.1.gem (100%)
Successfully installed cocoapods-downloader-1.1.1
Fetching: cocoapods-deintegrate-1.0.1.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.1
Fetching: cocoapods-core-1.1.0.beta.2.gem (100%)
Successfully installed cocoapods-core-1.1.0.beta.2
Fetching: cocoapods-1.1.0.beta.2.gem (100%)
Successfully installed cocoapods-1.1.0.beta.2
Parsing documentation for gh_inspector-1.0.2
Installing ri documentation for gh_inspector-1.0.2
Parsing documentation for fourflusher-1.0.1
Installing ri documentation for fourflusher-1.0.1
Parsing documentation for xcodeproj-1.3.0
Installing ri documentation for xcodeproj-1.3.0
Parsing documentation for molinillo-0.5.0
Installing ri documentation for molinillo-0.5.0
Parsing documentation for cocoapods-downloader-1.1.1
Installing ri documentation for cocoapods-downloader-1.1.1
Parsing documentation for cocoapods-deintegrate-1.0.1
Installing ri documentation for cocoapods-deintegrate-1.0.1
Parsing documentation for cocoapods-core-1.1.0.beta.2
Installing ri documentation for cocoapods-core-1.1.0.beta.2
Parsing documentation for cocoapods-1.1.0.beta.2
Installing ri documentation for cocoapods-1.1.0.beta.2
8 gems installed

也就是安装成功了,但是奇怪的是,我用pod --version得到的结果居然还是1.0.1,也就是说虽然安装了1.1.0 beta,但是无法使用。

为了检查是否真的安装了1.1.0.beta2,我又用sudo gem uninstall cocoapods检查了下,结果如下:

Select gem to uninstall:
 1. cocoapods-0.35.0
 2. cocoapods-0.37.2
 3. cocoapods-0.38.2
 4. cocoapods-0.39.0
 5. cocoapods-1.0.1
 6. cocoapods-1.1.0.beta.2
 7. All versions

发现确实安装了,到这里就有点蒙圈了。

后来试了几次,才发现,必须删了前面的所有版本,才能使用beta版。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值