sudo su - # as root
apt update
apt install build-essential libgdbm-dev libncurses-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev
logout # as ubuntu
# git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://gitee.com/Eric-Guo/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
type rbenv
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
git clone https://gitee.com/Eric-Guo/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# git clone https://github.com/andorchen/rbenv-china-mirror.git "$(rbenv root)"/plugins/rbenv-china-mirror
git clone https://gitee.com/Eric-Guo/rbenv-china-mirror.git "$(rbenv root)"/plugins/rbenv-china-mirror
rbenv install -l
|