RBENV(1)

πŸ¦‹ RBENV(1) β€” the Rbenv Manual, but make it cute πŸ¦‹

okay bestie, welcome to the Rbenv Manual πŸ’– this is the page that teaches you rbenv, and honestly? it's giving main character energy for your whole Ruby setup.


✨ NAME ✨

rbenv β€” manage your application's Ruby environment πŸ‘‘


🌸 SYNOPSIS 🌸

rbenv <command> [<args>...]

πŸ’… DESCRIPTION πŸ’…

so here's the tea β˜• rbenv respects the .ruby-version file in a project directory, and the way it does that is by making sure that any ruby, gem, bundle, or other Ruby command invocation automatically invokes the Ruby version configured for that project. no cap. it just handles it. 🫢

the way it pulls this off is by generating shims for all Ruby executables. as long as the rbenv shims directory is prepended to PATH, rbenv automatically ensures transparent switching between Ruby versions. literally magic, but it's just PATH bestie. πŸͺ„

and where does it look for available Ruby versions? in the $RBENV_ROOT/versions directory. remember that. it matters. πŸ’–


πŸŽ€ 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 it offers a plugin mechanism to hook into and override almost any aspect of its default behavior. obsessed. ✨

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ć


ok that's the whole page bestie, you ate that πŸ’… go forth and switch Ruby versions with confidence, iykyk πŸ’–

and fr fr, this was rbenv 1.3.2, dated 2023-11-08, from the RBENV(1) manual page. periodt. 🌟

πŸ“¦ where this page comes from