cocoaPods更新 2018-12-27

最近Pod的第三方版本旧了,要更新Pod update 出现报错,只能更新了一下本地cocoaPods库,cocoaPod库更新成功,可是还是报错,网上查一下需要Ruby在2.2.0以上,查询了下ruby在2.0.0,ruby --version,在2.2之下只能升级Ruby ,记录下升级过程:

首先安装RVM:

curl -L get.rvm.io | bash -s stable

网上查的载入rvm环境:

source ~/.rvm/scripts/rvm

rvm -v

还是不对,报这个:

RVM version 1.29.6 (latest) is installed yet 1.29.2 (latest) is loaded.

Please do one of the following:

  * 'rvm reload'

  * open a new shell

  * 'echo rvm_auto_reload_flag=1 >> ~/.rvmrc' # for auto reload with msg.

  * 'echo rvm_auto_reload_flag=2 >> ~/.rvmrc' # for silent auto reload

没看懂继续rvm install 2.3.0

还是报上面在这个错

rvm list 还是这样

按上面提示运行 rvm reload,好了,成功 RVM reloaded!

查看rvm中管理的所有ruby版本

rvm list known

安装 Ruby: rvm install 2.3.0

开始安装,时间有点长

最后 Ruby was built without documentation, to build it run: rvm docs generate-ri

rvm list 查看已安装ruby


查询ruby

安装成功

pod版本已更新,现在更新库 pod setup

报错:/Library/Ruby/Site/2.0.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)

from /Library/Ruby/Site/2.0.0/rubygems.rb:299:in `activate_bin_path'

from /usr/local/bin/pod:23:in `

修改默认版本 rvm use 2.3.0 --default 改回来了

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]

但是还是报错

更新下cocoaPods: 

sudo gem uninstall cocoapods

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

重新pod setup

好了

Setup completed

你可能感兴趣的:(cocoaPods更新 2018-12-27)