rbenv

Manage multiple Ruby versions per project

TLDR

List installed versions
$ rbenv versions
List available versions
$ rbenv install -l
Install Ruby version
$ rbenv install [3.2.0]
Set global version
$ rbenv global [3.2.0]
Set local version
$ rbenv local [3.2.0]
Show current version
$ rbenv version
Set shell-specific version
$ rbenv shell [3.2.0]
Rehash shims
$ rbenv rehash

SYNOPSIS

rbenv command [args...]

DESCRIPTION

rbenv manages multiple Ruby installations. It allows switching between Ruby versions globally, per-project, or per-shell, without modifying system Ruby.The tool uses shims to intercept Ruby commands and route them to the appropriate version based on context.

PARAMETERS

versions

List installed versions.
version
Show current version.
install version
Install Ruby version.
uninstall version
Remove Ruby version.
global version
Set global default.
local version
Set directory version.
shell version
Set shell version.
rehash
Rebuild shims.
which name
Show executable path.
init
Set up rbenv shims in the current shell.
exec command
Run an executable with the selected Ruby version.

INSTALL

sudo dnf install rbenv
sudo pacman -S rbenv
sudo zypper install rbenv
brew install rbenv
nix profile install nixpkgs#rbenv

CAVEATS

Requires ruby-build plugin for install. Shims need rehashing after gem installs. Per-project version via .ruby-version file.

HISTORY

rbenv was created by Sam Stephenson in 2011 as a simpler alternative to RVM. It focuses on doing one thing well - version switching - without modifying shells or managing gemsets.

SEE ALSO

ruby(1), gem(1), bundle(1), rvm(1), asdf(1)