-
Notifications
You must be signed in to change notification settings - Fork 56
Building Ruby
Below versions of Ruby are available in respective distributions at the time of creation of these build instructions:
- RHEL (8.8, 8.10) have
2.5.9
- RHEL (9.2, 9.4, 9.5) have
3.0.7
- SLES 15 SP6 has
2.5.1-21
- Ubuntu 20.04 has
2.7
- Ubuntu 22.04 has
3.0
- Ubuntu 24.04 has
3.2
- Ubuntu 24.10 has
3.3
The instructions provided below specify the steps to build Ruby version 3.4.2 on Linux on IBM Z following distributions:
- RHEL (8.8, 8.10, 9.2, 9.4, 9.5)
- SLES 15 SP6
- Ubuntu (20.04, 22.04, 24.04, 24.10)
General Notes:
-
When following the steps below please use a standard permission user unless otherwise specified.
-
A directory
/<source_root>/
will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you want to build Ruby using manual steps, go to STEP 2.
Use the following commands to build Ruby using the build script. Please make sure you have wget installed.
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Ruby/3.4.2/build_ruby.sh
# Build Ruby
bash build_ruby.sh [Provide -t option for executing build with tests]
If the build completes successfully, go to STEP 7. In case of error, check logs
for more details or go to STEP 2 to follow manual build steps.
export SOURCE_ROOT=/<source_root>/
-
RHEL (8.8, 8.10, 9.2, 9.4, 9.5)
sudo yum install -y bison flex openssl-devel readline-devel gdbm-devel gcc make wget tar libyaml-devel
-
SLES 15 SP6
sudo zypper install -y bison flex libopenssl-devel readline-devel gdbm-devel gcc make wget tar gzip gawk libyaml-devel
-
Ubuntu (20.04, 22.04, 24.04, 24.10)
sudo apt-get update sudo apt-get install -y gcc make wget tar bison flex openssl libssl-dev libdb-dev libgdbm-dev libreadline-dev libyaml-dev
cd $SOURCE_ROOT
wget http://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.2.tar.gz
tar zxf ruby-3.4.2.tar.gz
cd ruby-3.4.2
./configure
make
sudo make install
Note: Add /usr/local/bin
to PATH environment variable if not already present
make test
Note: The tests should not report any failures
ruby -v
gem env
Note: Rubygems support is contained as part of this build, so gem env
should work
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.