Rbenv is very useful, but with a small problem, each user needs to install and set up the version separately. The following installation steps can be installed under/usr/local/rbenv, and all users can share rbenv. #rbenv安装 (/usr/local/rbenv) #安装依赖, requires root user yum install -y gityum install -y readline-develyum install -y openssl-devel zlib-develyum install -y postgresql-devel# Turn off SSL authentication, if the clone reports a CA error, perform the following #git config --global http.sslverify falsegit clone https://github.com/sstephenson/rbenv.git /usr/local/rbenvecho ' Export RBENV_ROOT=/usr/ Local/rbenv ' >/etc/profile.d/rbenv.shecho ' export path= ' $RBENV _root/bin: $PATH "' >/etc/profile.d/ rbenv.shecho ' eval "$ (rbenv init -)" >>/etc/profile.d/rbenv.shgit clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build# Reload Profilesource ~/. bash_profile# View available Ruby version rbenv install --list# install a version Rbenv install 2.1.5rbenv global 2.1.5# using domestic gem source gem sources--remove Https://rubygems.org/gem Sources-a http://ruby.sdutlinux.org/gem Sources-lgem Install Bundle-v
Use rbenv to install Ruby for the entire system (available to all users)