Safe to Delete

RubyGems Cache & Obsolete Gems (~/.gem/ruby)

Quick Answer: The RubyGems cache stores downloaded gem archives and old gem versions. Clearing RubyGems cache is safe and frees up drive space.

Bottom Line: It is 100% safe to clean up the RubyGems cache. Running gem cleanup will NOT delete active Ruby application code or your Gemfile.lock.


What is the RubyGems Cache Folder?

Located at ~/.gem/ruby (or /Library/Ruby/Gems on macOS), this directory is used by RubyGems and Bundler (the package manager for Ruby and Ruby on Rails).

When you run bundle install, RubyGems downloads cached .gem tarballs into cache/ and installs compiled gem extensions. Over time, as Ruby applications update dependencies, old gem versions remain installed on disk, taking up 5 GB to 15 GB+.


Can You Delete RubyGems Cache?

✅ Yes, it is safe to clean up.

  • No Rails code risk: Your application source code and Gemfile remain 100% safe.
  • Purges obsolete versions: Running gem cleanup automatically removes older, unused gem versions while retaining the latest version.

How to Safely Clean Up RubyGems Cache

  1. Open your terminal.
  2. Remove all outdated gem versions:
    gem cleanup
  3. Purge cached .gem download archives:
    rm -rf ~/.gem/ruby/*/cache/*.gem

Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files