First of all, what is RVM for?
It is for managing well ruby versions and all of their corresponding gems. Further more, it also provides
gemset functionality which help you work with separate gem lists for each individual project (no more frustrating about gem versions conflicts, unreadable long list of a specific gem versions).
To know how to set it up, we have another article for you here.
Common RVM commands:
rvm use 2.2
To set default ruby version, run rvm use version –default
rvm gemset list
By default, after installing a new ruby version, rvm will install all related gems in default gemset. It also has a global gemset alongside. To create new gemset (1 gemset should be specific for 1 or some fairly similar projects), run rvm gemset create project_name
The use syntax is similar to choosing ruby version: rvm gemset use project_name
After creating a Rails app, what should I do to take advantage of rvm?
Create .ruby-version file to let RVM know which Ruby version we should use
Create .ruby-gemset file to let RVM know the name of gemset you would like to user and automatically create/navigate it when we make some changes to the gems. Why? Because if we separate each project’s gems to different gemsets, we won’t have to concern, worry about the potential conflicts between other versions of any gem, which is quite frustrating sometimes.
Pretty simple, right? Good luck on exploring RVM.