Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of installing Ruby on CentOS and RHEL

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the method of installing Ruby on CentOS and RHEL. It is very detailed and has a certain reference value. Interested friends must read it!

How do I install Ruby on CentOS/Rhel7/6? Ruby is a dynamic, object-oriented programming language that is simple and effective. RVM (Ruby version Manager) is a tool for installing and managing multiple Ruby versions on a single operating system.

Step 1: installation requirements

First, you need to install all the necessary ruby installation packages on our system using the following command.

# yum install gcc-c++ patch readline readline-devel zlib zlib-devel\ libyaml-devel libffi-devel openssl-devel make\ bzip2 autoconf automake libtool bison iconv-devel sqlite-devel

Step 2: install RVM

Now, install the latest stable version of RVM on your system using the following command. This command automatically downloads all required files and installs them on the system.

# curl-sSL https://rvm.io/mpapis.asc | gpg2-import-# curl-sSL https://rvm.io/pkuczynski.asc | gpg2-- import-# curl-L get.rvm.io | bash-s stabl

In addition, run the following command to load the RVM environment.

# source / etc/profile.d/rvm.sh# rvm reload

Step 3: verify dependencies

Now use the following command to verify that all dependencies are installed correctly. This will install other missing dependencies on your system.

# rvm requirements runChecking requirements for centos.Requirements installation successful

Step 4: install Ruby on CentOS

Your system is now ready for Ruby installation. You can use the following command to find the version of Ruby available for installation.

# rvm list known

Step 5: set the default Ruby version

First, check the version of Ruby currently installed on the system. In this way, we can find the version currently used by the system, as well as the version set as the default.

# rvm list ruby-2.4.4 [x86 / 64] * ruby-2.5.1 [x86 / 64] = > ruby-2.6.0 [x86 / 64] # = >-current# = *-current & & default# *-default

After that, use the rvm command to set the default Ruby version to be used by the application.

# rvm use 2.6-defaultUsing / usr/local/rvm/gems/ruby-2.6.0

Step 6: verify the current Ruby version

Using the following command, you can check which version of Ruby you are currently using.

# ruby-versionruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]

It is done, and Ruby has been successfully installed on the system.

The above is all the contents of the method of installing Ruby on CentOS and RHEL. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report