I can't even remember the last time I ran rvm implode, I'd reckon I've been using RVM for about three years.
Sure: I always update it via rvm get stable but I never really clean up old Rubies or gems, I only run bundle clean --force in each repository from time to time since I don't always use bundle exec.
In any case, time to see how much space it eats up on macOS via rvm disk-usage all:
Downloaded Archives Usage: 1.3M
Repositories Usage: 0B
Extracted Source Code Usage: 5.2M
Log Files Usage: 28K
Packages Usage: 0B
Rubies Usage: 298M
Gemsets Usage: 11G
Wrappers Usage: 212K
Temporary Files Usage: 0B
Other Files Usage: 5.6M
Total Disk Usage: 11G
Eleven gigabytes in total, almost all of it in gemsets according to this breakdown, wow, that's something. Let's try to clean this up a bit:
Step one
Always update RVM to its latest stable release:
$ rvm get stable
Step two
Share the gem cache with all Ruby versions (note this might introduce some subtle bugs if you like to edit your gems like me for debug purposes):
$ rvm gemset globalcache enable
Step three (attention destructive)
Before using a destructive third-party cleanup script, back up what you need, inspect the script, and prefer a dry run or a current RVM-supported cleanup command. Do not assume this old script is safe for a current installation.
The script by kugaevsky was what I used to further clean up my gems.
Note:
This process could be too destructive sometimes and you may need to run 'bundle' command from your project directory.
Step four
Let RVM clean-up after itself:
rvm cleanupLets you remove stale source folders / archives and other
$ rvm cleanup all
Note: this will take some time to complete.
Results
$ rvm disk-usage all
...
Total Disk Usage: 9.0G
Not bad (let's keep in mind that I did not remove any gemsets or Ruby installs and for my main projects I didn't need to run bundle after running kugaevsky's script).
Btw. if you're using a VM for development you can try this afterwards to further reduce its size.