-
Notifications
You must be signed in to change notification settings - Fork 56
Building Ruby on Rails
Below versions of Ruby on Rails are available in respective distributions at the time of creation of these build instructions:
- SLES (15 SP5, 15 SP6) have
5.2.3
- Ubuntu 20.04 has
5.2.3
- Ubuntu 22.04 has
6.1.4.1
- Ubuntu (24.04, 24.10) have
6.1.7.3
The instructions provided below specify the steps to build Rails version 8.0.1 on Linux on IBM Z for 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.
-
RHEL (8.8, 8.10)
sudo yum groupinstall -y 'Development Tools' sudo yum install -y zlib-devel zlib make gcc wget which patch gcc-c++ npm sqlite-devel curl libyaml-devel
-
RHEL (9.2, 9.4, 9.5)
sudo yum install -y rpmdevtools sudo yum install -y zlib-devel zlib make gcc wget which patch gcc-c++ npm sqlite-devel curl ruby ruby-devel libyaml-devel
-
SLES 15 SP6
sudo zypper install -y wget gcc zlib-devel gawk make patch tar gzip shared-mime-info sqlite-devel gcc-c++ libxslt-devel npm20 curl
-
Ubuntu 20.04
sudo apt-get update sudo apt-get install -y wget curl patch make gcc zlib1g-dev build-essential libsqlite3-dev npm tzdata pkg-config ruby-nokogiri git libyaml-dev
-
Ubuntu (22.04, 24.04, 24.10)
sudo apt-get update sudo apt-get install -y wget ruby ruby-dev curl patch make gcc zlib1g-dev build-essential libsqlite3-dev npm tzdata pkg-config ruby-nokogiri git libyaml-dev
wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Ruby/3.3.4/build_ruby.sh
bash build_ruby.sh -y
export GEM_HOME=$HOME/.gem/ruby
export PATH=$HOME/.gem/ruby/bin:$PATH
gem install rake # For Ubuntu
gem install rails -v 8.0.1 # For All except SLES 15.x
gem install rails -v 8.0.1 -- --use-system-libraries #For SLES 15.x
-
(Output)
Rails 8.0.1
-
Install
NodeJS
(Except SLES 15.x)cd $SOURCE_ROOT wget https://nodejs.org/download/release/v16.3.0/node-v16.3.0-linux-s390x.tar.gz tar xzf node-v16.3.0-linux-s390x.tar.gz export PATH=$SOURCE_ROOT/node-v16.3.0-linux-s390x/bin:$PATH node -v
-
Install required dependencies
gem install bundler sudo npm install -g yarn
-
Create a new Rails application and start the web server
mkdir myapp cd myapp echo "source 'https://rubygems.org'" > Gemfile echo "gem 'rails', '8.0.1'" >> Gemfile bundle install bundle exec rails new . --force --skip-bundle bundle install bin/rails server &
Note: Use -b to bind Rails to the specified IP. By default, it is localhost.
-
After starting Rails server, go to http://localhost:3000
curl http://127.0.0.1:3000
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.