Linux

Where Are Ruby Gems Installed?

Ruby gems install dirs via gem environment: system gemdir, user ~/.gem and bundler vendor paths.

Last updated

Gems install into versioned directories reported by gem environment: a system gemdir plus per-user ~/.gem paths. Bundler can vendor separately per project.

Versioned paths mean Ruby upgrades orphan old gem sets. The environment command prints live paths for the exact Ruby in use.

Where RubyGems stores this, by platform

Linux
~/.gem

Default user gem home; system gemdir varies by install (rbenv, rvm, distro). Confirm with gem environment gemdir. Bundler vendor/bundle overrides per project.

Frequently asked questions

How do I find where gems install?

Run gem environment gemdir (system) and gem environment | grep -A2 'GEM PATHS' for the full list. GEM_HOME and GEM_PATH overrides move everything; trust the command over defaults.

Notice an outdated path? Let us know.