nstall Ruby 3 on RHEL 8|CentOS 8|Rocky Linux 8-泓源视野

nstall Ruby 3 on RHEL 8|CentOS 8|Rocky Linux 8

In this guide, we will look at how you can Install Ruby 3 on RHEL 8 / CentOS 8 / Rocky Linux 8 system. Ruby is a dynamic, open source, object-oriented scripting language created with simplicity and productivity in mind. In this guide, I’ll show you how to Install Ruby 3 on RHEL 8 / CentOS 8 / Rocky Linux 8 with RVM Ruby Version Manager.

Option 1) Install Ruby 3 on RHEL 8|CentOS 8|Rocky Linux 8 from Repo

RHEL 8 provides Ruby 2 and 3 in AppStream repository. You can confirm its availability using the command:

$ sudo yum module list rubyRocky Linux 8 - AppStream
Name Stream Profiles Summary
ruby 2.5 [d] common [d] An interpreter of object-oriented scripting language
ruby 2.6 common [d] An interpreter of object-oriented scripting language
ruby 2.7 common [d] An interpreter of object-oriented scripting language
ruby 3.0 common [d] An interpreter of object-oriented scripting language
ruby 3.1 common [d] An interpreter of object-oriented scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Disable default Ruby AppStream module on your system

****gem sources --add http://rubygems.org
sudo dnf module reset ruby -y

To specify the module version, use the command:

sudo yum install @ruby:3.0  *****  yum install ruby-devel
****gem install nokogiri --platform=ruby
*** rvm install ruby-3.0.2
***gem install bundler
**gem update --system
gem env
bundle install

Proceed with the installation:

**** git clone https://github.com/wpscanteam/wpscan

 

cd wpscan

gem install wpscan

....
Dependencies resolved.
====================================================================================================================================================================================================== Package Architecture Version Repository Size
======================================================================================================================================================================================================
Installing group/module packages: ruby x86_64 3.1.2-141.module+el8.7.0+1081+f0a69743 appstream 88 k
Installing dependencies: ruby-default-gems noarch 3.1.2-141.module+el8.7.0+1081+f0a69743 appstream 78 k ruby-libs x86_64 3.1.2-141.module+el8.7.0+1081+f0a69743 appstream 3.3 M rubygem-io-console x86_64 0.5.11-141.module+el8.7.0+1081+f0a69743 appstream 72 k rubygem-json x86_64 2.6.1-141.module+el8.7.0+1081+f0a69743 appstream 99 k rubygem-psych x86_64 4.0.3-141.module+el8.7.0+1081+f0a69743 appstream 98 k
Installing weak dependencies: rubygem-bigdecimal x86_64 3.1.1-141.module+el8.7.0+1081+f0a69743 appstream 113 k rubygem-bundler noarch 2.3.7-141.module+el8.7.0+1081+f0a69743 appstream 448 k rubygem-rdoc noarch 6.4.0-141.module+el8.7.0+1081+f0a69743 appstream 517 k rubygems noarch 3.3.7-141.module+el8.7.0+1081+f0a69743 appstream 319 k
Installing module profiles: ruby/common
Enabling module streams: ruby 3.1
Transaction Summary
======================================================================================================================================================================================================
Install 10 Packages
Total download size: 5.1 M
Installed size: 16 M
Is this ok [y/N]: y

Once installed, check version:

$ ruby --versionruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

Option 2) Install Ruby 3 using rbenv on RHEL 8|CentOS 8|Rocky Linux 8

Rbenv is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. Install RVM on RHEL 8 by running the commands below in your terminal.

Install common tools required

sudo dnf -y install git make gcc curl openssl-devel zlib-devel libffi-devel readline-devel sqlite-devel

Install required rbenv tool by running the following commands:

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

Configure environment for Rbenv

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc

Confirm rbenv version

$ rbenv -vrbenv 1.2.0-59-g0704e65

Print a list of all Ruby versions that can be installed with rbenv:

$ rbenv install -l2.7.7
3.0.5
3.1.3
3.2.1
jruby-9.4.1.0
mruby-3.2.0
picoruby-3.0.0
truffleruby-22.3.1
truffleruby+graalvm-22.3.1

Let’s install Ruby 3.2.1:

$ rbenv install 3.2.1Installing ruby-3.2.1...
Installed ruby-3.2.1 to /home/technixleo/.rbenv/versions/3.2.1

Setting installed Ruby as global version:

rbenv global 3.2.1

Confirm Ruby version:

$ ruby --version

You have successfully installed Ruby on RHEL 8|CentOS 8|Rocky Linux 8.

Similar:

YOU CAN SUPPORT OUR WORK WITH A CUP OF COFFEE


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

nstall Ruby 3 on RHEL 8|CentOS 8|Rocky Linux 8插图
本文由 泓源视野 作者:admin 发表,其版权均为 泓源视野 所有,文章内容系作者个人观点,不代表 泓源视野 对观点赞同或支持。如需转载,请注明文章来源。
15

发表评论

Protected with IP Blacklist CloudIP Blacklist Cloud
您是第8237684 位访客, 您的IP是:[3.236.86.184]