There are currently two tools for managing Ruby versions on Mac OS: RVM and rbenv. This article mainly covers how to install and use rbenv, and how to manage your Ruby environment through it.
# List available versions rbenv install --list # Install 2.4.0 rbenv install 2.4.0 # Show installed versions rbenv versions # system # 2.1.5 # 2.2.1 # * 2.2.4 (set by /Users/Robbs/.rbenv/version) # Set the global version rbenv global 2.4.0 # Set the local version rbenv local 2.4.0 # Unset the local version rbenv local --unset # Set the version for the current shell rbenv shell 2.4.0 # Use the system Ruby rbenv global system # You must run this command after switching Ruby versions and after running bundle install rbenv rehash # Uninstall a Ruby version rbenv uninstall 2.4.0