Shannon Skipper edited this page Jul 3, 2018 · 66 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-get 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 readline libyaml gdbm libffi
Alpine Linux
sudo apk add gcc g++ make linux-headers zlib-dev gdbm-dev openssl-dev readline-dev

Installation

Note: MRI requires OpenSSL >= 1.0.1.

wget https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2
tar -xjvf ruby-2.5.1.tar.bz2
cd ruby-2.5.1
./configure --prefix=/opt/rubies/ruby-2.5.1
make
sudo make install

Note: macOS users must update their OpenSSL CA cert bundle and properly set ./configure --with-opt-dir to compile against Homebrew's libraries:

curl --remote-name https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.bz2
tar -xjvf ruby-2.5.1.tar.bz2
cd ruby-2.5.1
./configure --prefix="$HOME/.rubies/ruby-2.5.1" --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi)"
make -j2
make install
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.