Where Does Ruby Store Installed Gems?
RubyGems installs user gems under ~/.gem with defaults in ~/.gemrc, while Bundler vendors project gems into vendor/bundle when configured.
Last updated
RubyGems defaults to a user-local gem home, which keeps casual installs away from system Ruby. Gems land versioned under ~/.gem, and ~/.gemrc tunes sources and install flags. Version managers layer their own gem sets on top without moving this default.
Bundler adds project isolation on demand. With a local path configured, bundle install vendors gems into the project tree instead of the shared home. System-wide installs (sudo gem) scatter into distro paths instead, which is why user installs behave more predictably.
Where Ruby stores this, by platform
~/.gem
User-installed gems versioned by Ruby. gem env prints the live resolution order. Managers (rbenv, RVM, system) add their own paths without relocating this default.
~/.gem
Same user gem home on macOS. System Ruby belongs to the OS; real work happens under a manager Ruby or Homebrew Ruby resolving user gems here.
Frequently asked questions
Where did my gem actually install?
Run gem env and read GEM PATHS. It prints every location gems resolve from, including version-specific folders and any GEM_HOME override, which beats guessing across managers.
How do I isolate gems per project?
Set the path in .bundle/config (usually vendor/bundle) and run bundle install. The gems then live inside the project, isolated from system and manager Rubies alike.
Notice an outdated path? Let us know.