RUBY-BUILD(1)

✨ ruby-build ✨

aka the manual page for ruby-build, from the ruby-build Manual πŸŽ€


🌸 NAME 🌸

ruby-build β€” download, compile, and install a version of Ruby πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

ruby-build [-dvpk] <definition> <prefix> [-- <configure-args>...]
ruby-build {--list|--definitions}
ruby-build --version

πŸ’… DESCRIPTION πŸ’…

okay so bestie, here's the whole vibe: ruby-build downloads, compiles, and installs a Ruby version β€” the one named by the definition argument β€” into the location you give it as prefix. that's it. that's the whole thing. no cap. ✨

the definition argument can optionally start with "ruby-", and if it does, it resolves to a CRuby that matches the version number that follows. cute, right?

the definition argument can also be a path to a file on disk β€” in which case it gets sourced into ruby-build as a bash script. 🐚

and optionally, you can list extra Ruby configure-args after "--" and they'll get forwarded to the ./configure invocation. forward them. slay.

by default, all compile output is redirected to a log file at $TMPDIR/ruby-build.*.log. if you wanna skip the log file and print everything to standard streams, just activate verbose mode. πŸ‘‘


🌈 OPTIONS 🌈

  • -l, --list β€” list latest stable releases for each Ruby πŸ“‹
  • --definitions β€” list all local definitions, including the outdated ones (yes, even the old ones, we don't judge) πŸ—‚οΈ
  • --version β€” show version of ruby-build 🏷️
  • -d, --dir β€” install the Ruby in the prefix/definition destination instead of directly in prefix πŸ“
  • -v, --verbose β€” verbose mode: forward all build output to stdout/stderr πŸ”Š
  • -p, --patch β€” apply a patch from stdin before building 🩹
  • -k, --keep β€” do not remove source tree after installation (keep it, bestie) 🌱
  • -4, --ipv4 β€” resolve names to IPv4 addresses only 4️⃣
  • -6, --ipv6 β€” resolve names to IPv6 addresses only 6️⃣

πŸ“ EXAMPLES πŸ“

install a Ruby version while tweaking some configuration options:

$ ruby-build 3.2.2 /path/to/destination -- --disable-install-doc --with-openssl-dir=/opt/openssl

install a Ruby version to ~/.rubies/ruby-3.2.2:

$ ruby-build --dir ruby-3.2.2 ~/.rubies

install a Ruby version to ~/.rbenv/versions/3.3.5:

$ ruby-build --dir 3.3.5 ~/.rbenv/versions

usage as rbenv plugin β€” accomplishes the same as the previous example:

$ rbenv install 3.3.5

🧚 ENVIRONMENT VARIABLES 🧚

  • TMPDIR β€” the location to write temporary files on disk πŸ—„οΈ
  • RUBY_BUILD_BUILD_PATH (default: a timestamped subdirectory of TMPDIR) β€” the build location for downloading source files to and compiling πŸ—οΈ
  • RUBY_BUILD_CACHE_PATH (default: "~/.rbenv/cache" if invoked as rbenv plugin) β€” where to cache downloaded package files πŸ“¦
  • RUBY_BUILD_HTTP_CLIENT (default: first tool found in PATH) β€” one of "aria2c", "curl", or "wget" to use for downloading 🌐
  • RUBY_BUILD_ARIA2_OPTS β€” additional options to pass to aria2c for downloading
  • RUBY_BUILD_CURL_OPTS β€” additional options to pass to curl for downloading
  • RUBY_BUILD_WGET_OPTS β€” additional options to pass to wget for downloading
  • RUBY_BUILD_MIRROR_URL (default: a sponsored Amazon CloudFront mirror) β€” custom mirror URL root to download packages from πŸͺž
  • RUBY_BUILD_MIRROR_PACKAGE_URL β€” custom complete mirror URL πŸ”—
  • RUBY_BUILD_SKIP_MIRROR β€” bypass the download mirror and fetch all package files from their original URLs πŸš€
  • RUBY_BUILD_ROOT (default: "share/ruby-build" within ruby-build install location) β€” custom build definition directory 🌳
  • RUBY_BUILD_TARBALL_OVERRIDE β€” override the URL to fetch the ruby tarball from, optionally followed by "#<checksum>"
  • RUBY_BUILD_DEFINITIONS β€” paths to search for build definitions in addition to RUBY_BUILD_ROOT πŸ”
  • CC β€” path to the C compiler πŸ”§
  • RUBY_CFLAGS β€” additional CFLAGS options to use for Ruby compilation
  • CONFIGURE_OPTS β€” additional "./configure" arguments βš™οΈ
  • MAKE (default: "make") β€” custom make command (e.g., "gmake") πŸ› οΈ
  • MAKE_OPTS, MAKEOPTS β€” additional arguments for "make"
  • MAKE_INSTALL_OPTS β€” additional arguments for "make install"
  • RUBY_CONFIGURE_OPTS β€” additional "./configure" arguments that apply only to Ruby source πŸ’Ž
  • RUBY_MAKE_OPTS β€” additional make arguments that apply only to Ruby source πŸ’Ž
  • RUBY_MAKE_INSTALL_OPTS β€” additional "make install" arguments that apply only to Ruby source πŸ’Ž
  • NO_COLOR (default: allow colors when connected to terminal) β€” disable ANSI colors in output 🚫🌈
  • CLICOLOR_FORCE β€” use ANSI colors in output even when not connected to a terminal 🌈✨

πŸ‘‘ NOTES πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Mislav Marohnić


and that's the whole page, bestie πŸ’– go forth and install Ruby, you absolute icon 🫢

this was ruby-build 20250916.1, dated 2024-09-23, from the ruby-build Manual. periodt. πŸ’…

πŸ“¦ where this page comes from