前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Cocospod 升级到指定版本

Cocospod 升级到指定版本

作者头像
星宇大前端
发布2019-05-07 15:35:42
6K0
发布2019-05-07 15:35:42
举报
文章被收录于专栏:大宇笔记大宇笔记

1.检查当前安装版本列表

代码语言:javascript
复制
gem list --local | grep cocoapods
代码语言:javascript
复制
NvrdeiMac:ValidateSwift nvr$ gem list --local | grep cocoapods
cocoapods (1.6.0.beta.1, 1.5.3)
cocoapods-core (1.6.0.beta.1, 1.5.3)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.1)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.1, 1.3.0)
cocoapods-try (1.1.0)

2.卸载不用版本

当前命令要卸载1.5.3

代码语言:javascript
复制
sudo gem uninstall cocoapods   1.5.3
代码语言:javascript
复制
NvrdeiMac:ValidateSwift nvr$ sudo gem uninstall cocoapods 1.5.3
Gem '1.5.3' is not installed

Select gem to uninstall:
 1. cocoapods-1.5.3
 2. cocoapods-1.6.0.beta.1
 3. All versions
> 1. cocoapods-1.5.3
Successfully uninstalled cocoapods-1.5.3

3.安装指定版本

当前命令要安装1.6.1

代码语言:javascript
复制
sudo gem install cocoapods -v 1.6.1

如果遇到ruby源错误:

代码语言:javascript
复制
ERROR:  Could not find a valid gem 'cocoapods' (= 1.6.1), 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)

解决传送门

然后就成功了:

代码语言:javascript
复制
NvrdeiMac:ValidateSwift nvr$ sudo gem install cocoapods -v 1.6.1
Password:
Fetching: ruby-macho-1.4.0.gem (100%)
Successfully installed ruby-macho-1.4.0
Fetching: fourflusher-2.2.0.gem (100%)
Successfully installed fourflusher-2.2.0
Fetching: xcodeproj-1.8.2.gem (100%)
Successfully installed xcodeproj-1.8.2
Fetching: cocoapods-downloader-1.2.2.gem (100%)
Successfully installed cocoapods-downloader-1.2.2
Fetching: cocoapods-core-1.6.1.gem (100%)
Successfully installed cocoapods-core-1.6.1
Fetching: cocoapods-1.6.1.gem (100%)
Successfully installed cocoapods-1.6.1
Parsing documentation for ruby-macho-1.4.0
Installing ri documentation for ruby-macho-1.4.0
Parsing documentation for fourflusher-2.2.0
Installing ri documentation for fourflusher-2.2.0
Parsing documentation for xcodeproj-1.8.2
Installing ri documentation for xcodeproj-1.8.2
Parsing documentation for cocoapods-downloader-1.2.2
Installing ri documentation for cocoapods-downloader-1.2.2
Parsing documentation for cocoapods-core-1.6.1
Installing ri documentation for cocoapods-core-1.6.1
Parsing documentation for cocoapods-1.6.1
Installing ri documentation for cocoapods-1.6.1
Done installing documentation for ruby-macho, fourflusher, xcodeproj, cocoapods-downloader, cocoapods-core, cocoapods after 7 seconds
6 gems installed
NvrdeiMac:ValidateSwift nvr$ pod --version
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring http_parser.rb-0.6.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.6.0
1.6.1
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年04月23日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.检查当前安装版本列表
  • 2.卸载不用版本
  • 3.安装指定版本
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档