Setup Ruby on CentOS 8
This guide explains how to setup Ruby on CentOS using Ruby version manager.
dnf install curl
dnf install gnupg2
dnf install tar
Install the latest stable version of RVM on your system using the following command. This command will automatically download all required files and install on your system.
Eg :
Prerequisite
CentOS 8 minimal installation with latest available updates
Resolve Dependencies
To begin with Ruby installation, it requires a set of packages on the system. Following steps to resolve the same.
dnf install gnupg2
dnf install tar
Installing Ruby Version Manager (RVM)
RVM is a command-line tool that allows us to install, manage, and work with different ruby environments.Install the latest stable version of RVM on your system using the following command. This command will automatically download all required files and install on your system.
Install GPG keys
As a first step install GPG keys used to verify installation package:
Key can be found at RVM websiteEg :
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
Above key information is a sample do not copy. Do refer website for updated key information
Install RVM
curl -sSL https://get.rvm.io | bash
Add user root to user group rvm, group rvm created while installing RVM.
source /etc/profile.d/rvm.sh
rvm requirements
rvm list known
rvm install 2.7.0
Note: Above command install ruby with version 2.7.0, Change the version number based on requirements.
rvm use 2.7.0 --default
The version printed should match with the version set as default.
Add user root to user group rvm, group rvm created while installing RVM.
usermod -a -G rvm root
Update/Setup RVM Environment
The command makes the target system environment readyreload rvm source
rvm reload
Install Ruby requirements
External packages required for Ruby can be resolved by installing the following command
rvm requirements
Ruby Installation
List all available version of ruby for installation
Chose one version from the list and perform install command with the version
Note: Above command install ruby with version 2.7.0, Change the version number based on requirements.
Set Ruby default version
if multiple version of ruby installed, set a version as default.Verify the default version
ruby --versionList locally available ruby version
rvm listIt lists all version of ruby present in the target system
Sources used :
Comments
Post a Comment