RVM (Ruby Version Manager) and You!

Kevin Gleeson
2 min readJan 2, 2021
Please stand by for a message from our sponsors.

Have you ever started a project with ‘rails new’ and not wanted to use your default version of ruby?

Moreover, you might have already begun work on a project to later find you need to change versions.

Now there’s no need to worry about such problems with…RVM! Also known as the Ruby Version Manager.

To Start

Just like little Timmy needs to start his day with a tall glass of milk, you should probably know which version of Ruby is currently your default version.

I’m sure your code will go big and strong, just like young Timmy here.

RVM has the tools for such a task. In your command line, simply type the ‘rvm list’ to see a list of all of the versions of Ruby currently installed on your machine.

Here we can see our current and default version of ruby is 2.6.1

If your list only contains one version of Ruby and it’s not the version you’d like to use, consider the following.

For a New Project

Doris here is showing the boys that they don’t have the right version of Ruby for breakfast.

Don’t be like Doris and plan ahead! Before creating your new application, install the version of Ruby that you would like with the following line of code.

rvm install VERSION.NUMBER.HERE

Once this process has completed, once you open your RVM list, you should see two versions of Ruby installed on your device.

From there, to set the version that you’d like to use in your project as the default version, after opening your RVM list simply type the following code.

rvm --default use VERSION.NUMBER.HERE

Now this way we’ll start our project with the correct version of Ruby.

For an Existing Project

That deadline sure is coming quick! Better duck and cover!

Looks like the Smith family needs to make a quick change to their Ruby version to safely survive crunch time. Luckily for them, rvm makes this easy!

If the version you’d like your project to be in is already installed on your computer, you only need to do one thing!

rvm use VERSION.NUMBER.HERE

If it’s not installed, install it with the ‘rvm install’ command from above and then simply change versions with ‘rvm use’.

--

--

Kevin Gleeson

Software Engineering Graduate from Flatiron School. Former expatriate and music teacher.