---
name: "ruby-build"
section: "1"
platform: "linux"
package: "ruby-build"
version: "20260924-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ruby-build"
---

# ruby-build(1)

Download, compile, and install a version of Ruby

## 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 --resolve *\<version\>*\
 ruby-build --version

## DESCRIPTION

ruby-build downloads, compiles, and installs a Ruby version named by the *definition* argument into the location specified by *prefix*.

The *definition* argument can be a path to a file on disk, in which case it is sourced into ruby-build as a bash script.

Optionally, extra Ruby *configure-args* may be listed after "--" and will get forwarded to the `./configure` invocation.

By default, all compile output is redirected to a log file at `$TMPDIR/ruby-build.*.log`. Activate the verbose mode to skip the log file and print everything to standard streams.

## RUBY VERSIONS

When listing "latest" Ruby versions, such as in `--list` output, ruby-build only knows of Ruby versions that are bundled with this project. That means that when a new Ruby version comes out, ruby-build will not know about it immediately; you will have to upgrade ruby-build before you can use it to install the new Ruby version.

## RUBY IMPLEMENTATIONS

ruby-build ships with definitions for the following Ruby implementations:

• CRuby, also known as "MRI": denoted by version numbers in form of "X.Y.Z". This is the main Ruby implementation that most people use.

• "jruby": High-performance Ruby implementation with real threading built on top of the Java virtual machine (JVM).

• "mruby": Lightweight Ruby for microcontrollers.

• "picoruby": Alternative mruby implementation for one-chip microcontrollers.

• "truffleruby": The Native standalone distribution of TruffleRuby, an implementation of Ruby on top of GraalVM’s Truffle framework.

• "truffleruby+graalvm": The JVM standalone distribution of TruffleRuby.

The *definition* argument may optionally start with "ruby-", in which case it resolves to a CRuby that matches the version number that follows. The *definition* argument may also be a name of one of the alternative Ruby implementations, in which case the latest version of that implementation will be installed.

## OPTIONS

- **-l, --list**

  List latest stable releases for each Ruby

- **--definitions**

  List all local definitions, including outdated ones

- **--resolve**

  Print the definition name of the latest stable Ruby version matching the *version* argument

- **--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

- **-4, --ipv4**

  Resolve names to IPv4 addresses only

- **-6, --ipv6**

  Resolve names to IPv6 addresses only

## EXAMPLES

Install a Ruby version while tweaking some configuration options:

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

Install a Ruby version to `~/.rubies/ruby-3.4.9`:

```
$ ruby-build --dir ruby-3.4.9 ~/.rubies
```

Install the latest Ruby 3.x version to `~/.rubies/ruby-3.x.y`:

```
$ ruby-build --dir ruby-3 ~/.rubies
```

Install a Ruby version to `~/.rbenv/versions/3.3.11`:

```
$ ruby-build --dir 3.3.11 ~/.rbenv/versions
```

Usage as rbenv plugin, accomplishes the same as the previous example:

```
$ rbenv install 3.3.11
```

## 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

•  \<https://github.com/rbenv/ruby-build#readme\>

•  \<https://github.com/rbenv/ruby-build/wiki\>

•  \<https://github.com/rbenv/ruby-build/discussions\>

## AUTHOR

Mislav Marohnić
