If you’re using Rbenv :
https://makandracards.com/makandra/21545-rbenv-how-to-switch-to-another-ruby-version-temporarily-per-project-or-globally
If you’re using RVM :
https://rvm.io/rubies/default
If you’re not using any of these: you should be using one of these.
solved Change the version of ruby [closed]