How can I install ruby ββ2.2.1 if I'm on 2.2.2?
Option for Ruby version control rbenv . I prefer it to RVM because it's not that intrusive (it doesn't need to be loaded into your shell, it doesn't override shell commands, it doesn't manage the gemset, etc.).
In your case, to install an older version of Ruby, you can do the following after installing rbenv:
Check the available Ruby versions:
rbenv install -l
The above list should display a list of all available versions (option 2.2.1 should be available in your script). Then, once you have selected the version you want to install, the following command can be run like this:
rbenv install 2.2.1
Finally, To switch between ruby ββversions, you can run:
rbenv local 2.2.1
Or set Ruby 2.2.1 to default globally:
rbenv global 2.2.1
More details such as installation instructions can be found in the README
Hope this was helpful to you!
source to share