iOS开发之pod升级方法

cocoaPods需要gem工具来安装,而gem则需要ruby环境的支持:

1.如果rvm的版本过低就无法更新gem。
1> .查看ruby版本:$ /usr/bin/ruby -v
使用homeBrew安装rvm:

2> .安装homeBrew:
a.安装homeBrew需要Xcode依赖库的支持,先装Xcode。
xcode-select --install
b.安装homeBrew(注意以下是一条命令)。
/usr/bin/ruby -e " ( c u r l − f s S L h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / H o m e b r e w / i n s t a l l / m a s t e r / i n s t a l l ) " c . 查 看 是 否 安 装 成 功 ( 一 般 输 出 " Y o u r s y s t e m i s r e a d y t o b r e w . " 成 功 ) 。 b r e w d o c t o r d . 查 看 安 装 的 h o m e B r e w 版 本 : (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" c.查看是否安装成功(一般输出"Your system is ready to brew."成功)。 brew doctor d.查看安装的homeBrew版本: (curlfsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"c.("Yoursystemisreadytobrew."brewdoctord.homeBrew brew -v

3>.安装rvm(ruby):
\curl -sSL https://get.rvm.io | bash -s stable
b.查看rvm版本:
rvm -v
c.查看ruby镜像地址:
gem sources -l
d.更换gem源地址。
gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/

2.如果gem版本太低就无法更新pod版本。
查看gem版本:
gem -v
升级gem版本:
sudo gem update --system
3.安装pod最新版本:
sudo gem install -n /usr/local/bin cocoapods --pre

4、重装cocopods:
1>. 卸载命令:
sudo gem uninstall cocoapods
2>. 先查看本地安装过的cocopods相关东西,命令如下:
gem list --local | grep cocoapods
2.1>. 查看pod安装路径:
which pod
2.2>. 移除之前安装过的资源:
sudo rm -rf /usr/local/bin/pod
3>. 安装指定版本的pod:
$ sudo gem install cocoapods --version 0.24.0

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值