Ruby projects often depend on specific Ruby versions and gem sets.
RVM (Ruby Version Manager) helps isolate those dependencies so:
- projects don’t conflict
- upgrades are controlled
- development environments stay predictable
This cheatsheet focuses on everyday RVM commands, not edge cases.
List available Ruby versions:
rvm list knownInstall a specific version:
rvm install 3.2.2List installed versions:
rvm listSet a default Ruby:
rvm --default use 3.2.2Use a Ruby version for the current shell:
rvm use 3.2.2Use a Ruby version temporarily:
rvm use 3.1.4 --temporaryCheck the active Ruby:
ruby -vAlways confirm which Ruby you’re running before debugging issues.
Gemsets isolate dependencies within a Ruby version.
Create a gemset:
rvm gemset create myappUse a gemset:
rvm gemset use myappList gemsets:
rvm gemset listDelete a gemset:
rvm gemset delete myappGemsets prevent dependency bleed between projects.
Create a .ruby-version file:
echo "3.2.2" > .ruby-versionCreate a .ruby-gemset file:
echo "myapp" > .ruby-gemsetWhen entering the directory, RVM will prompt to trust and switch automatically.
Update RVM itself:
rvm get stableUpgrade Ruby:
rvm upgrade 3.1.4 3.2.2Remove an old Ruby version:
rvm remove 2.7.8Cleaning unused versions reduces confusion.
Install Bundler for the active Ruby:
gem install bundlerInstall project dependencies:
bundle installBundler respects the active Ruby and gemset.
Reload RVM environment:
source ~/.rvm/scripts/rvmCheck RVM requirements:
rvm requirementsDiagnose environment issues:
rvm doctorMany Ruby issues trace back to mismatched versions or gemsets.
RVM modifies shell behavior.
Common issues arise when:
- shells aren’t loading RVM scripts
- multiple version managers are installed
- PATH order is incorrect
Avoid mixing RVM with other Ruby managers unless you understand the interactions.
- Keep Ruby versions explicit per project
- Remove versions you no longer need
- Use gemsets sparingly but intentionally
- Trust
.ruby-versionfiles only from known sources - Verify environment before debugging app errors
Environment clarity saves hours.
- RVM manages Ruby versions and gem isolation
- A small command set covers most workflows
- Project-level files improve consistency
- Most Ruby issues start with environment drift
- Discipline beats memorization
A clean Ruby environment makes application problems much easier to reason about.