rbenv - Man Page
manage your application's Ruby environment
Examples (TL;DR)
- Install a Ruby version:
rbenv install version
- Display a list of the latest stable versions for each Ruby:
rbenv install --list
- Display a list of installed Ruby versions:
rbenv versions
- Use a specific Ruby version across the whole system:
rbenv global version
- Use a specific Ruby version for an application/project directory:
rbenv local version
- Display the currently selected Ruby version:
rbenv version
- Uninstall a Ruby version:
rbenv uninstall version
- Display all Ruby versions that contain the specified executable:
rbenv whence executable
Synopsis
rbenv <command> [<args>...]
Description
rbenv respects the .ruby-version file in a project directory by making sure that any ruby, gem, bundle, or other Ruby command invocation automatically invokes the Ruby version configured for that project.
It does so by generating shims for all Ruby executables. As long as rbenv shims directory is prepended to PATH, rbenv automatically ensures transparent switching between Ruby versions.
rbenv looks for available Ruby versions in the $RBENV_ROOT/versions directory.
Commands
- rbenv global [<version>]
View or change the global Ruby version
- rbenv local [<version>]
View or change the local Ruby version
- rbenv shell [<version>]
View or change the Ruby version for the current shell session
- rbenv version
View the currently active Ruby version and where it is set from
- rbenv versions
List all locally installed Ruby versions known to rbenv
- rbenv install [<version>]
(Provided by the ruby-build plugin) Download and install a new Ruby version
- rbenv rehash
Regenerate shims for all known Ruby executables
- rbenv which [<command>]
View the executable path that a command resolves to
- rbenv init
Help bootstrap rbenv into the current shell environment
- rbenv help [<command>]
View help text for any rbenv command
Environment Variables
- RBENV_VERSION (default: read from .ruby-version file)
The Ruby version name to be used
- RBENV_ROOT (default: ~/.rbenv)
The location where rbenv discovers Ruby versions, plugins, and other configuration
- RBENV_DEBUG
Activates printing debug information about rbenv internals to standard error
- RBENV_HOOK_PATH
Colon-separated list of paths searched for rbenv plugin scripts
- RBENV_DIR (default: $PWD)
Directory to traverse bottom-up to locate the .ruby-version file
Plugins
As its core functionality, rbenv only switches between Ruby versions and does nothing else, but offers a plugin mechanism to hook into and override almost any aspect of its default behavior.
The most common plugin for rbenv is ruby-build which facilitates installing new Ruby versions into the $RBENV_ROOT/versions directory.
Read more at https://github.com/rbenv/rbenv/wiki/Plugins
Notes
Author
Mislav Marohnić