talira

ruby-build

Download, compile, and install Ruby on Unix-like systems

open sourceMITself-hostablefree

ruby-build is a command-line tool that installs any Ruby version from source on Unix-like systems. It works as an rbenv plugin (the rbenv install command) or on its own as ruby-build: it downloads the official source tarball, configures and compiles it, links a suitable OpenSSL (building one if needed) and checks that the new Ruby works. It ships build definitions for CRuby, JRuby, mruby, PicoRuby and TruffleRuby, and takes custom definitions, mirrors and build flags through environment variables.

Ways to install

Problems it solves

  • install the exact Ruby version a project needs, compiled from source
  • get rbenv install working so I can switch between Ruby versions per project
  • install JRuby, TruffleRuby or mruby alongside the standard Ruby
  • compile Ruby linked against a working OpenSSL without fighting configure flags
  • build a patched or custom Ruby from my own build definition
  • install the newest patch release of a Ruby series without looking up the exact version number
  • speed up repeated Ruby installs by caching downloaded source tarballs or using a mirror

Features

  • rbenv install command as an rbenv plugin
  • standalone ruby-build command
  • build definitions for CRuby, JRuby, mruby, PicoRuby and TruffleRuby
  • installs the latest release of a series (rbenv install 3)
  • custom build definition files and directories
  • links or builds a compatible OpenSSL
  • download cache and mirror support
  • configure, make and compiler flags through environment variables

Limitations

  • Doesn't run on Windows: it builds Ruby from source on Unix-like systems3
  • Doesn't know about a new Ruby release until you upgrade it: each version's build definition ships with ruby-build3
  • Doesn't check for system build dependencies before compiling: install build tools and development headers first3

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what ruby-build does.

  1. Fullstaq Ruby A server-optimised Ruby distribution: precompiled MRI packages built with jemalloc and malloc_trim.
  2. RVM Ruby Version Manager: install several Ruby interpreters side by side and switch between them, each with its own named gemsets.
  3. asdf Manage multiple runtime versions with a single CLI tool, extendable via plugins
  4. mise dev tools, env vars, task runner
  5. pyenv Simple Python version management
  6. tfenv Terraform version manager inspired by rbenv

Compare ruby-build with the top 3