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. JavaScript 之 页面加载事件

    一.onload 加载事件 onload 是 window 对象的一个事件,也可以省略 window 直接使用. 常用方式: <head><script> windown.on ...

  2. ES6的新特性

    ECMAScript 6(简称ES6)是JavaScript语言的下一代标准.因为当前版本的ES6是在2015年发布的,又称ECMAScript 2015.ES6就是ES2015. 虽然目前并不是所有 ...

  3. Python 字符串常用函数

    操作字符串的常用函数 函数 描述(返回值) str.capitalize() 将字符串的第一个字符大写 str.title() 返回标题化的字符串,即每个单词的首字母都大写 str.upper() 全 ...

  4. 7 静态分析Android

    静态分析两种方式: 1. 阅读反汇编的Dalvik字节码:使用IDA 分析dex文件或baksmali反编译的smali文件 2. 阅读反汇编的Java源码:使用dex2jar生成jar文件,用jd- ...

  5. springboot如何读取配置文件中的参数(例如:application-consts.properties) 又结合maven读取配置文件的顺序

    1.启动项目后,会读取pom.xml中的配置文件,例如现在读取的是本地配置 2.找到对应的配置文件  会读取uri地址下的配置.注:如果为springboot启动无需加config项目的名称,应该本身 ...

  6. java常见数据结构的时间复杂度总结

  7. vue.js生成横向拓扑图

    1.前端代码 <link href="https://magicbox.bk.tencent.com/static_api/v3/assets/bootstrap-3.3.4/css/ ...

  8. abp记录1

    1在AbpWebApplication中的的构造函数中创建abpBootstrapper 实例,在Application_Start执行AbpBootstrapper值初始化方式 2AbpBootst ...

  9. Tomcat热部署和热加载

    1.热部署与热加载 在应用运行的时候升级软件,无需重新启动的方式有两种,热部署和热加载.它们之间的区别是: (1).部署方式: 热部署在服务器运行时重新部署项目.热加载在运行时重新加载class. ( ...

  10. OKR究竟适不适合国内企业?

    某天见到知乎上有人提问,OKR在中国能行的通吗?细看下面的回复,多数人觉得大部分企业都是不适合的,他们认为让普通员工主动付出努力去达到更高的要求是不可能的,并且公司环境也不适合OKR的推行.但我却有不 ...