RVM (Ruby Version Manager) and You!
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.
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.
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
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
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’.