I don't want to update my pre-installed Ruby to the latest version.
My question is: how can I upgrade the version of Ruby to version 2.1.6 on Mac via terminal?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Since homebrew has moved on to ruby version 2.4.2 you might not have luck installing that far back a version.
I've not used RVM lately, since I'm happy with keeping up with the ruby version that's stable (and let home brew update things since I have no legacy projects needing 2.1), but give the following steps a shot. This will side load another version that's older than what Apple ships.
Once that's installed:
rvm install 2.1.6 rvm --default use 2.1.6