How to Install Ruby on CentOS/RHEL 7/6 . Ruby is a dynamic, object-oriented programming language focused on simplicity and productivity. RVM (Ruby Version Manager) is a tool for installing and managing multiple Ruby versions on single operating systems. This tutorial will help you to install RVM on your system. After that install the latest Ruby on CentOS and RedHat systems using RVM.

Step 1 – Installing Requirements

First of all, you need to install all required packages for ruby installation 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 will automatically download all required files and install on your 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 stable

Also, run below 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 all dependencies are properly installed. This will install any missing dependencies on your system.

rvm requirements run

Checking requirements for centos.
Requirements installation successful.

Step 4 – Install Ruby on CentOS

Now, your system is ready for the Ruby installation. You can find the available Ruby version for installation using below command.

rvm list known

Then install the required Ruby version on your system. Here, I am installing Ruby 2.6 on my CentOS system. You can simply replace the version to below command of your choice and install.

rvm install 2.6

Step 5 – Setup Default Ruby Version

First of all, check the currently installed ruby versions on your system. So that we can find which version is using currently by the system and which is set to 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 rvm command to set up the default ruby version to be used by applications.

rvm use 2.6 --default

Using /usr/local/rvm/gems/ruby-2.6.0

Step 6 – Verify Active Ruby Version

Using following command you can check the current ruby version is used.

ruby --version

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

Congratulation’s, Finally you have successfully installed Ruby on your system. Read our next articles to deploy Ruby with Apache or Ruby with Nginx web server with simple steps.

References: 
1. http://rvm.io/rubies/installing

How to Install Ruby on CentOS/RHEL 7/6的更多相关文章

  1. Steps to Install Hadoop on CentOS/RHEL 6---reference

    http://tecadmin.net/steps-to-install-hadoop-on-centosrhel-6/# The Apache Hadoop software library is ...

  2. How to Install Tomcat 8.0.27 on CentOS/RHEL and Ubuntu【转】

    https://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu/ Apache Tomcat is an opensource web ...

  3. Install Google Chrome on Fedora 28/27, CentOS/RHEL 7.5 (在 fedora 28 等 上 安装 chrome)

    今天在使用 fedora 安装 chrome 的时候遇到了问题,今天进行将安装过程进行记录下来.需要安装第三方软件仓库. 我们需要进行安装 fedora-workstation-repositorie ...

  4. Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7

    Install LAMP Server (Apache, MariaDB, PHP) On CentOS/RHEL/Scientific Linux 7 By SK  - August 12, 201 ...

  5. [转载]How to Install Google Chrome 39 in CentOS/RHEL 6 and Fedora 19/18

    FROM: http://tecadmin.net/install-google-chrome-in-centos-rhel-and-fedora/ Google Chrome is a freewa ...

  6. [转载]Install Opera 12.16 Web Browser in CentOS/RHEL and Fedora

    FROM: http://tecadmin.net/install-opera-web-browser-in-centos-rhel-fedora/ Opera is an modern web br ...

  7. 转: How to Install MongoDB 3.2 on CentOS/RHEL & Fedora (简单易懂)

    from:  http://tecadmin.net/install-mongodb-on-centos-rhel-and-fedora/ MongoDB (named from “huMONGOus ...

  8. 如何在CentOS/RHEL & Fedora上安装MongoDB 3.2

    MongoDB(名称取自"huMONGOus")是一个有着全面灵活的索引支持和丰富的查询的数据库.MongoDB通过GridFS提供强大的媒体存储.点击这里获取MongoDB的更多 ...

  9. How To Install Java on CentOS and Fedora

    PostedDecember 4, 2014 453.8kviews JAVA CENTOS FEDORA   Introduction This tutorial will show you how ...

随机推荐

  1. 老生常谈之js深拷贝与浅拷贝

    前言 经常会在一些网站或博客看到"深克隆","浅克隆"这两个名词,其实这个很好理解,今天我们就在这里分析一下js深拷贝和浅拷贝. 浅拷贝 我们先以一个例子来说明 ...

  2. ML-线性 SVM 推导

    Max Margin svm 即Suport Vector Machine, 中文意为:支持向量机. 对于二分类问题, 在样本空间中(即便是多维向量, 在空间中可表示为一个点). svm的核心思想就是 ...

  3. java 时间格式

    自定义时间格式:yyyy 年MM 月dd 天HH 24小时制hh 12小时制mm 分钟ss 秒 java.util.Date日期格式为:年月日时分秒 java.sql.Date日期格式为:年月日jav ...

  4. 宝塔面板1G内存安装mysql5.7提示“至少需要XX兆内存”的解决办法

    打开文件:/www/server/panel/class/panelPlugin.py 搜索关键词:“至少” (可能在134行) 然后把这行if语句注释掉,如下图:

  5. Shell 编程 循环语句

    本篇主要写一些shell脚本循环语句的使用. for 循环 指定次数 #!/bin/bash for ((i=1;i<=10;i++)) do echo $i done [root@localh ...

  6. spark遇到的问题及解决方法

    1. 表中数据过亿,加载速度过慢,而我只需要加载增量数据 如:加载昨天一整天的数据,添加predicates分区,方法如下: //predicates相当于是把昨天的数据分成一个区,其它的数据不加载 ...

  7. saltstack--状态判断unless与onlyif

    saltstack状态判断unless与onlyif 很多时候我们在编写 state 文件时候需要进行判断,判断该目录或文件是否存在,判断该配置是否已经已添加,然后根据判断结果再决定命令或动作是否执行 ...

  8. jenkins忘记admin密码的处理方法

    如果忘记admin的登录密码,可按如下方法处理 # 编辑config.xml文件,替换passwordHash行的内容# vim /var/lib/jenkins/users/admin_167938 ...

  9. C++学习(9)—— 对象的初始化及清理

    1. 构造函数和析构函数 对象的初始化和清理是两个非常重要的安全问题 ​ 一个对象或者变量没有初始状态,对其使用后果是未知 ​ 同样的使用完一个对象或者变量,没有及时清理,也会造成一些安全问题   C ...

  10. php装饰器模式(decorator pattern)

    十一点了. <?php /* The decorator pattern allows behavior to be added to an individual object instance ...