The following installation steps can be installed under/usr/local/rbenv, and all users can share rbenv.
#rbenv安装 (/usr/local/rbenv)
#安装依赖, the root user is required
Yum install-y git
Yum Install-y readline-devel
Yum install-y openssl-devel Zlib-devel
Yum Install-y postgresql-devel
#关闭ssl验证, if the clone reports a CA error, perform the following
#git Config--global http.sslverify false
git clone https://github.com/sstephenson/rbenv.git/usr/local/rbenv
echo ' Export rbenv_root=/usr/local/rbenv ' >/etc/profile.d/rbenv.sh
echo ' Export path= ' $RBENV _root/bin: $PATH "' >>/etc/profile.d/rbenv.sh
Echo ' eval ' $ (rbenv init-) "' >>/etc/profile.d/rbenv.sh
git clone https://github.com/sstephenson/ruby-build.git/usr/local/rbenv/plugins/ruby-build
#重新加载profile
SOURCE ~/.bash_profile
#查看可用ruby版本
Rbenv Install--list
#安装某一版本
Rbenv Install 2.1.5
Rbenv Global 2.1.5
#使用国内gem源
Gem Sources--remove https://rubygems.org/
#gem sources-a http://ruby.sdutlinux.org/
Gem Sources-a https://ruby.taobao.org/
Gem Sources-l
Gem Install Bundle-v
Install Ruby for the entire system with RBENV (available to all users)