Centos7搭建Ruby环境
先安装gcc环境
yum install gcc-c++
获取密钥
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
获取rvm
curl -sSL https://get.rvm.io | bash -s stable
根据输出的提示执行
source /home/gy/.rvm/scripts/rvm
可以使用rvm命令,列出所有已知源
rvm list known
输出如下
# MRI Rubies [ruby-]1.8.6[-p420] [ruby-]1.8.7[-head] # security released on head [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p330] [ruby-]1.9.3[-p551] [ruby-]2.0.0[-p648] [ruby-]2.1[.10] [ruby-]2.2[.10] [ruby-]2.3[.7] [ruby-]2.4[.4] [ruby-]2.5[.1] [ruby-]2.6[.0-preview2] ruby-head
安装ruby,需要一定时间(好几分钟)
rvm install ruby-2.5.1
切换使用当前版本(有时候不指定的话,gem命令无法识别)
rvm use 2.5.1 default
验证
// 执行命令 ruby -v // 成功输入如下 ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
执行安装redis与ruby的接口
gem install redis
安装成功提示如下
Fetching: redis-4.0.2.gem (100%) Successfully installed redis-4.0.2 Parsing documentation for redis-4.0.2 Installing ri documentation for redis-4.0.2 Done installing documentation for redis after 0 seconds 1 gem installed
相关推荐
PMJ0 2020-10-13
longzhiwen 2020-09-06
yangxingstar 2020-08-31
LUCIEN0 2020-08-17
huangzihao00 2020-08-17
Jan 2020-08-17
AndesStay 2020-06-12
afengxg 2020-06-09
zamesking 2020-06-09
afengxg 2020-06-09
何志文 2020-06-09
teresalxm 2020-06-05
何志文 2020-05-16
何志文 2020-05-11
fsl 2020-05-04
JOO 2020-04-26
倩 2020-04-22
afanti 2020-04-19
始终不够 2020-04-10