I recommend visiting the RMV website (https://rvm.io/). Upon the browser rendering the RVM website, you find two simple bash commands you can use to install RVM. I opted not to print the commands in here as 1) a digital security measure and 2) may change as time goes on.
Once installed, we can begin installing the latest version of Ruby.
rvm list known
This command lists the current versions of Ruby available to install. There may be a lot on the list, but we can focus on the primary interpreter MRI plus, the latest version(2.6.x as of writing). Now, the command to install:
rvm install 2.6.5
Now sit back or grab a coffee as the install can take anywhere from 1 to many minutes to complete. This wait is based on Ruby package availability, system speed, and plenty of other factors.
Once the gems are installed, you can now set up a
gemset. A gemset is a way to group installed gems into a particular RVM based folder. Gemsets keep different projects and their various versions of gems from interfering with each other. Although with Bundler, this isn’t a huge issue, it doesn’t hurt to take the extra step and keep your gems tidy. Additionally, this command instructs RVM to use the recently installed version of Ruby at the same time:
rvm use 2.6.5@sample_app --create
--create flag tells RVM to create the gemset if it doesn’t
exist(which it doesn’t).
Now that we finally have our Ruby and Gemsets in order we can install Rails. We are starting a new sample project to show you the basics of a new Rails app. Later we rerun this command for the SaaS app’s creation. Please refer to the RVM documentation if you want to dig deeper into any other features of RVM past the basics in this chapter.