解决 安装cocoapods失败,提示 requires Ruby version >=2.2.2
步骤如下:
rvm install ruby-2.2
但是,但是竟然报错了,具体我忘记额,但是是权限和brew的问题,那么我又转向修复brew:
// 清理原来brew
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
// 安装
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
// 检查有无问题
brew doctor
brew解决后,我赶紧去试试rvm install ruby-2.2,但是提示:
Already installed ruby-2.2.4.
To reinstall use:
rvm reinstall ruby-2.2.4
OK,换成rvm reinstall ruby-2.2.4,成功,再去试试安装cocoapods
sudo gem install -n /usr/local/bin cocoapods --pre
关键命令:
$ rvm autolibs read-only # read more here: https://rvm.io/rvm/autolibs
$ rvm install ruby # or any version you want