Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 13, 2026·3 min de lecture

RVM — Ruby Version Manager for Developers

RVM is a command-line tool for installing, managing, and switching between multiple Ruby versions and gemsets on macOS and Linux systems.

Prêt pour agents

Installation avec revue préalable

Cet actif nécessite une revue. Le prompt copié demande un dry-run, affiche les écritures, puis continue seulement après confirmation.

Needs Confirmation · 64/100Policy : confirmer
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
RVM Overview
Commande avec revue préalable
npx -y tokrepo@latest install a7e5ddf3-7eb9-11f1-9bc6-00163e2b0d79 --target codex

Dry-run d'abord, confirmez les écritures, puis lancez cette commande.

Introduction

RVM (Ruby Version Manager) is a shell tool that lets developers install, manage, and work with multiple Ruby environments on a single machine. It compiles Ruby from source, manages gemsets for dependency isolation, and automatically switches Ruby versions when entering project directories. RVM has been the standard Ruby version manager since 2009.

What RVM Does

  • Installs multiple Ruby interpreters (MRI, JRuby, TruffleRuby) from source or binaries
  • Switches between Ruby versions globally, per shell, or per project directory
  • Manages gemsets to isolate gem dependencies between projects
  • Reads .ruby-version and .ruby-gemset files for automatic per-project switching
  • Provides wrappers for cron jobs and scripts that need a specific Ruby environment

Architecture Overview

RVM works by modifying shell environment variables (PATH, GEM_HOME, GEM_PATH) to point to the selected Ruby installation and gemset. It installs Ruby versions into ~/.rvm/rubies/ and stores gemsets under ~/.rvm/gems/. A shell function (loaded via sourcing a script in your profile) intercepts the cd command to detect .ruby-version files and switch environments automatically. RVM can compile Ruby from source using its own build recipes or install precompiled binaries when available.

Self-Hosting & Configuration

  • Install via the official installer script: curl -sSL https://get.rvm.io | bash -s stable
  • Source the RVM script in your shell profile: source ~/.rvm/scripts/rvm
  • Install Ruby versions with rvm install (e.g., rvm install 3.3.0)
  • Create per-project .ruby-version and .ruby-gemset files for automatic switching
  • Use rvm autolibs enable to let RVM install required system dependencies automatically

Key Features

  • Compiles Ruby from source with optimized build flags or installs precompiled binaries
  • Gemsets provide dependency isolation without requiring Bundler for every project
  • Automatic environment switching on directory change via .ruby-version files
  • Named gemsets for maintaining separate gem environments per project or client
  • Supports MRI, JRuby, TruffleRuby, Rubinius, and other Ruby implementations

Comparison with Similar Tools

  • rbenv — lighter approach using shims instead of shell functions; no gemsets built in
  • chruby — minimal Ruby switcher with no installer; pair with ruby-install
  • asdf + ruby plugin — multi-language version manager; RVM is Ruby-specific with gemsets
  • mise — modern polyglot tool manager; RVM has deeper Ruby-specific features
  • Docker — full isolation via containers; RVM provides lighter per-user Ruby management

FAQ

Q: RVM vs rbenv — which should I use? A: Use RVM if you want built-in gemsets and an all-in-one installer. Use rbenv if you prefer a minimal shim-based approach.

Q: Do I still need Bundler with RVM gemsets? A: Bundler is still recommended for reproducible dependency resolution. Gemsets provide an extra isolation layer on top of Bundler.

Q: How do I update RVM itself? A: Run rvm get stable to update to the latest stable release.

Q: Does RVM work on macOS with Apple Silicon? A: Yes. RVM compiles Ruby natively for ARM64 on Apple Silicon Macs.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires