Skip to content
Postmodern edited this page Jan 14, 2024 · 83 revisions

CRuby or MRI (Matz's Ruby Implementation), is the defacto Ruby and sets the standards for other Ruby implementations.

Requirements

Operating System Command
Debian / Ubuntu
sudo apt install -y build-essential bison zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libffi-dev
RedHat / Fedora
sudo dnf install -y gcc automake bison zlib-devel libyaml-devel openssl-devel gdbm-devel readline-devel libffi-devel
openSUSE
sudo zypper install gcc automake bison gdbm-devel libffi-devel libyaml-devel openssl-devel readline-devel zlib-devel
Arch Linux
sudo pacman -S gcc make bison zlib openssl readline libyaml gdbm libffi
FreeBSD
sudo pkg install bison gdbm libffi libyaml openssl readline
NetBSD
sudo pkgin -y install bison gdbm libffi libyaml openssl readline
macOS
brew install automake bison openssl@3 readline libyaml gdbm libffi
Alpine Linux
sudo apk add gcc g++ make linux-headers zlib-dev gdbm-dev openssl-dev readline-dev

Installation

wget https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz
tar -xJvf ruby-3.3.0.tar.xz
cd ruby-3.3.0
./configure --prefix=/opt/rubies/ruby-3.3.0
make
sudo make install

Note: macOS users must properly specify ./configure --with-openssl-dir=... --with-opt-dir=... to compile Ruby against Homebrew's packages:

curl --remote-name https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.xz
tar -xJvf ruby-3.3.0.tar.xz
cd ruby-3.3.0
./configure --prefix="$HOME/.rubies/ruby-3.3.0" --with-openssl-dir="$(brew --prefix openssl@3)" --with-opt-dir="$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm)"
make -j4
make install
Clone this wiki locally