//Install Ruby
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
//Add description to .bashrc
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
//Check the version of Ruby that can be installed
rbenv install -l
//Install Ruby
rbenv install 3.0.4
//gcc installation error
sudo apt install gcc
//Make installation error
sudo apt install make
//lack of "openssl", "readline" and "zlib" error
apt-get install -y libssl-dev libreadline-dev zlib1g-dev
//specify the version with rbenv
rbenv global 3.0.4
//check the version of Ruby
ruby -v