curl -sSL https://get.rvm.io | bash -s stable –ruby
however once you install it, if you type rvm in command tool, you maybe meet this error : rvm bash not found
Why?
Actually the solution is very easy : close command tool and open it again.
Next install ruby with certain version:
rvm install 2.2.2 //version >=2.2.2 is the requried version for install cocoapods with command “sudo gem install cocoapods”
do not need “rvm use 2.2.2 –default”