在安装cocoapods中遇到的坑(ERROR: Error installing cocoapods: activesupport requires Ruby version >= 2.2)

1.查看所有的ruby版本

$rvm list known

2.如果提示command not found 请先安装rvm

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

如果遇到错误:Failed to connect to get.rvm.io port 80: Connection refused

$curl -L get.rvm.io | bash -s stable 改为curl -L raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable

等待一段时间后就可以成功安装好 RVM。

终端输入:

$ source ~/.bashrc

$ source ~/.bash_profile

测试是否安装正常

rvm -v

3.用RVM升级Ruby

$ rvm list known

$ rvm install 2.2.2

你可能感兴趣的:(在安装cocoapods中遇到的坑(ERROR: Error installing cocoapods: activesupport requires Ruby version >= 2.2))