Here’s a modified version of instructions provided by Yosei Ito. I used
apt remove
instead of apt uninstall
.
sudo apt remove ruby-build
$ mkdir -p "$(rbenv root)"/plugins
$ git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
This worked very well for me, helping me to install Ruby 2.7.3, and install the gem dependencies for this website without any errors or need for using ‘sudo’ when installing gems via Bundler.