Skip to content

Building Ruby on Rails

aborkar-ibm edited this page Apr 6, 2021 · 78 revisions

Building Ruby on Rails

Below versions of Ruby on Rails are available in respective distributions at the time of creation of these build instructions:

  • Ubuntu 18.04 has 4.2.10
  • Ubuntu 20.04 has 5.2.3
  • Ubuntu 20.10 has 5.2.4.3
  • SLES 15 SP2 has 5.2.3

The instructions provided below specify the steps to build Rails version 6.1.3 on Linux on IBM Z for following distributions:

  • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
  • SLES (12 SP5, 15 SP2)
  • Ubuntu (18.04, 20.04, 20.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.

Step 1: Build Ruby

1.1) Build Ruby

1.2) Correct the gem environment for a standard user

  • RHEL (7.8, 7.9) , SLES 12 SP5

       export GEM_HOME=$HOME/.gem/ruby
       export PATH=$HOME/.gem/ruby/bin:$PATH
    
  • RHEL (8.1, 8.2, 8.3)

       export PATH=$HOME/bin:$PATH
    

Step 2: Install Ruby on Rails

2.1) Add build dependencies

  • RHEL (7.8, 7.9)

    sudo yum install -y patch make gcc
    
  • RHEL (8.1, 8.2, 8.3)

    sudo yum groupinstall -y 'Development Tools'
    sudo yum install -y zlib zlib-devel ruby-devel patch
    
  • SLES 12 SP5

    sudo zypper install -y patch make gcc shared-mime-info
    
  • SLES 15 SP2

    sudo zypper install -y ruby2.5 ruby2.5-devel gcc zlib-devel gawk make patch tar gzip shared-mime-info
    
  • Ubuntu (18.04, 20.04, 20.10)

    sudo apt-get update
    sudo apt-get install -y ruby ruby-dev make gcc zlib1g-dev patch
    

2.2) Install Ruby on Rails via gem

   sudo gem install rake                   # For Ubuntu
   gem install rails -v 6.1.3              # For RHEL and SLES 12.x
   sudo gem install rails -v 6.1.3         # For Ubuntu and SLES 15.x
   sudo ln -sf /usr/lib64/ruby/gems/2.5.0/gems/railties-6.1.3/exe/rails /usr/bin/rails   # For SLES 15.x

2.3) Ruby on Rails is now installed. Verify version with command rails -v

  • (Output)

    Rails 6.1.3

References:

Clone this wiki locally