1、安装的工具包
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison sqlite-devel iconv-devel
2、安装rvm(ruby管理工具)
[root@mail ~]# curl -L get.rvm.io | bash -s stable
如果遇到以下错误:
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software found. Assuming you trust Michal Papis import the mpapis public key (downloading the signatures). GPG signature verification failed for '/usr/local/rvm/archives/rvm-1.26.11.tgz' - 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc'! try downloading the signatures: gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 or if it fails: command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import - the key can be compared with: https://rvm.io/mpapis.asc https://keybase.io/mpapis
那么复制
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
在控制台运行一次,然后再次运行
[root@mail ~]# curl -L get.rvm.io | bash -s stable
安装成功最后会提示:
# Administrator, # # Thank you for using RVM! # We sincerely hope that RVM helps to make your life easier and more enjoyable!!! # # ~Wayne, Michal & team.
3、运行以下命令:
echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc && source /etc/profile.d/rvm.sh
4、那么接下来可以使用rvm来安装ruby了
4.1、使用
rvm list known
列出rvm知道的ruby版本,那么在这里就可以看到有什么版本可以安装了。在这里我选择ruby-2.2.1
rvm install ruby-2.2.1
rvm可以帮助我们将ruby所依赖的包也一起安装进来。
4.2、切换要使用的ruby版本
rvm use 2.2.1
4.3、输出变量参数
echo "export rvm_max_time_flag=20" >> ~/.rvmrc
5、检查gem sources的链接地址。如果是https://rubygems.org/,那么要移除掉。
换成http://rubygems.org/或http://ruby.taobao.org
gem sources --remove https://rubygems.org/ gem sources -a http://ruby.taobao.org
安装配置完成。
相关推荐
centos7.0安装mysql centos7.0安装mysql centos7.0安装mysql
Centos7下安装MongoDB
CentOs下安装PHP扩展 curl 务器运行一段时间后,可能突然会需求添加某个扩展,如curl、pdo、xmlrpc等,这就需要在不重新编译Linux PHP的情况下独立添加扩展。
centos 6.5下安装配置mysql,以及mysql的安全管理和账户管理
CentOS7安装Git
CentOS 7 安装 MySQL
CentOS7安装指南
CentOS是Linux发行版之一,相信不少朋友想知道CentOS系统安装配置的方法,下面小编给大家介绍下安装配置CentOS6.6的具体步骤,感兴趣的朋友不妨来了解下吧。
centos6.7安装jdk1.8全部详细过程,若有疑问,欢迎联系!
CentOS7下安装oracle11g具体步骤
centos 7.6安装流程下载详细安装过程,在网上看到特别好的教程,很好地解决了小白的问题,为此特意记录下来了。附件如下:centos 7.6安装流程.docx
Centos7.9安装部署Zabbix6,需要安装包的发邮箱,文件里面包含邮箱地址
centos下安装oracle,centos下安装oraclecentos下安装oracle
Centos7.9安装zabbix6.0LTS版
在Centos7安装golang教程
CentOS 8 安装图解
centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7安装详细教程centos7...
centos 下安装svn服务器
对于新入门的开发者,如何安装 Ruby, Ruby Gems 和 Rails 的运行环境可能会是个问题,下面这篇文章主要给大家分享了在CentOS 7下配置Ruby语言开发环境的方法教程,文中介绍的非常详细,需要的朋友们下面来一起看看吧...
Centos7.9安装配置vsftpd