Question
How can I completely remove RVM (Ruby Version Manager) from my system?
I want to uninstall RVM and clean up any related shell configuration or environment changes it may have added.
Short Answer
By the end of this page, you will understand how RVM removal works, what files and shell settings are involved, how to delete it safely, and how to verify that your Ruby environment is clean afterward.
Concept
RVM is a Ruby version manager. It installs Ruby versions, gemsets, and shell integration so you can switch Ruby environments easily.
When people ask how to remove RVM, the real concept is uninstalling a developer tool that modifies your shell environment.
This matters because tools like RVM usually do more than place a single executable on your system. They often:
- create installation directories
- add lines to shell startup files such as
.bashrc,.bash_profile, or.zshrc - modify your
PATH - install wrappers, scripts, and environment hooks
If you only delete the main folder, your shell may still try to load RVM on startup. That can cause:
command not founderrors- broken
PATHentries - Ruby commands pointing to missing locations
- confusing environment behavior
So removing RVM usually involves two parts:
- Delete the RVM installation files
- Remove shell configuration lines that load RVM
The exact files depend on how RVM was installed:
- Single-user install: usually in
~/.rvm - Multi-user/system install: often in
/usr/local/rvmor a similar system directory
After removal, you should restart your shell and verify that:
rvmis no longer available- your
PATHno longer references RVM - Ruby commands now come from your system Ruby or another version manager
Mental Model
Think of RVM like a workshop setup tool.
- The RVM folder is the toolbox itself.
- Your shell config files are the instructions taped to the wall telling your terminal where to find that toolbox.
To fully remove RVM, you must:
- throw away the toolbox
- remove the wall instructions
If you only do one of those steps, your terminal may still look for tools that no longer exist.
Syntax and Examples
The most common Unix shell commands involved are:
rvm implode
This is RVM's built-in removal command for many installations.
You may also need to delete the installation directory manually:
rm -rf ~/.rvm
Then remove RVM-related lines from shell config files such as:
~/.bashrc
~/.bash_profile
~/.zshrc
~/.profile
Typical RVM-related config may look like this:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
or:
source /usr/local/rvm/scripts/rvm
After editing those files, reload your shell:
source ~/.bashrc
Or restart the terminal completely.
Example removal flow
rvm implode
rm -rf ~/.rvm
Then open your shell config file and remove lines that mention .
Step by Step Execution
Consider this simple terminal session:
rvm implode
rm -rf ~/.rvm
which rvm
Step by step:
-
rvm implode- Runs RVM's uninstall command.
- If RVM is installed and working, it attempts to remove its files and setup.
-
rm -rf ~/.rvm- Deletes the hidden
.rvmfolder in your home directory. - This is usually where a single-user RVM installation lives.
-rmeans recursive, and-fmeans force.
- Deletes the hidden
-
which rvm- Checks whether your shell can still find the
rvmcommand. - If nothing is returned, that is a good sign.
- If a path still appears, your shell config or
PATHstill references RVM.
- Checks whether your shell can still find the
Traceable example with PATH
Suppose before cleanup:
echo $PATH
Real World Use Cases
Removing RVM is useful in several practical situations:
-
Switching to another Ruby version manager
- For example, moving from RVM to
rbenv,asdf, or system Ruby.
- For example, moving from RVM to
-
Fixing a broken Ruby environment
- If shell startup files or version selection became inconsistent, a clean uninstall may be easier than debugging everything.
-
Cleaning a development machine
- Old tools can clutter
PATH, startup scripts, and package directories.
- Old tools can clutter
-
Preparing a shared machine
- On team systems or CI environments, you may want a simpler Ruby setup.
-
Reprovisioning a workstation
- Developers often remove language managers before reinstalling tools from scratch.
Real Codebase Usage
In real projects, developers usually treat version managers like part of the local development environment, not part of the application codebase.
Common patterns include:
-
Environment validation
- Teams check
ruby -vorwhich rubywhen debugging setup problems.
- Teams check
-
Guard clauses in setup scripts
- A script may check whether
rvmexists before trying to use it.
- A script may check whether
if command -v rvm >/dev/null 2>&1; then
echo "RVM is installed"
else
echo "RVM is not installed"
fi
-
Early cleanup during migration
- When moving to another tool, developers first remove old shell hooks so the new tool controls Ruby selection cleanly.
-
PATH inspection for debugging
- A common troubleshooting step is checking whether
~/.rvm/binor other RVM paths are still present.
- A common troubleshooting step is checking whether
-
Configuration review
Common Mistakes
Here are common mistakes beginners make when removing RVM.
1. Deleting the folder but not shell config
Broken approach:
rm -rf ~/.rvm
This removes files, but your shell may still try to load RVM on startup.
Avoid it by also checking:
~/.bashrc~/.bash_profile~/.zshrc~/.profile
2. Forgetting system-wide installs
If RVM was installed for all users, it may live outside your home directory, such as:
/usr/local/rvm
Removing only ~/.rvm will not uninstall that kind of setup.
3. Not restarting or reloading the shell
After editing shell files, your current terminal session may still hold old environment values.
Use:
source ~/.zshrc
or reopen the terminal.
4. Assuming which rvm is enough
Even if is gone, your may still contain RVM directories.
Comparisons
| Approach | What it does | Pros | Cons |
|---|---|---|---|
rvm implode | Uses RVM's own uninstall command | Safer and intentional | May not remove every shell config line |
rm -rf ~/.rvm | Manually deletes user installation files | Simple and direct | Does not clean shell config by itself |
| Edit shell config only | Removes startup loading of RVM | Fixes shell errors | Leaves files on disk |
| Full cleanup | Delete files and remove config lines | Most complete result | Requires checking multiple locations |
RVM removal vs uninstalling a normal package
| Tool type |
|---|
Cheat Sheet
# Try RVM's own uninstall command
rvm implode
# Remove a user install if it still exists
rm -rf ~/.rvm
# Check whether rvm is still available
which rvm
# Check where ruby comes from
which ruby
ruby -v
# Inspect PATH for leftover RVM entries
echo $PATH
Files to inspect
~/.bashrc~/.bash_profile~/.zshrc~/.profile/etc/profile/etc/zshrc
Common lines to remove
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
source /usr/local/rvm/scripts/rvm
Rules
- Remove both files and
FAQ
How do I completely uninstall RVM?
Run rvm implode if available, delete the RVM directory such as ~/.rvm, and remove RVM-related lines from your shell config files.
Where is RVM usually installed?
For a single-user install, it is commonly in ~/.rvm. For a system-wide install, it may be in /usr/local/rvm.
Why is my terminal still referencing RVM after I deleted it?
Your shell startup files probably still contain source lines or PATH entries that point to RVM.
How can I check whether RVM is still on my PATH?
Use:
echo $PATH
Look for entries such as ~/.rvm/bin or /usr/local/rvm.
Do I need to restart the terminal after removing RVM?
Yes, or reload the relevant shell config file with source. Otherwise your current session may still use old environment values.
Will removing RVM remove Ruby itself?
It removes Ruby versions managed by RVM. It does not necessarily remove a system Ruby or Ruby installed by another tool.
Mini Project
Description
Create a small shell-based cleanup checklist for removing RVM from a development machine. This project helps you practice identifying installation directories, checking shell configuration, and verifying that environment changes are gone after removal.
Goal
Build a simple Bash script that detects common RVM installation traces and guides you through verifying a clean uninstall.
Requirements
- Check whether the
rvmcommand exists. - Check whether
~/.rvmexists. - Search common shell config files for lines containing
rvm. - Print the current
rubypath and version. - Show whether the current
PATHstill includes RVM-related directories.
Keep learning
Related questions
How to Call Shell Commands from Ruby and Capture Output
Learn how to run shell commands in Ruby, capture output, check exit status, and choose the right method for scripts and apps.
How to Check Whether a String Contains a Substring in Ruby
Learn how to check if a string contains a substring in Ruby using include?, match, and multiline string examples.
How to Check if a Hash Key Exists in Ruby
Learn how to check whether a specific key exists in a Ruby hash using key?, has_key?, and include? with clear examples.