Use rbenv
List all available versions
rbenv install -l
Install Ruby 2.2.1
rbenv install 2.2.1
Uninstall Ruby 2.2.1
rbenv uninstall 2.2.1
See installed versions
rbenv versions
Set global version
rbenv global 2.2.1
Set local version
rbenv local 2.2.1
An alternative is rvm
.