In the attempt to install ruby 2.7.1 using rbenv I noticed the version was not listed on my ubuntu 18.04
$ rbenv install -l | grep 2.7.
2.7.0-dev
2.7.0-preview1
jruby-9.2.7.0
rbx-2.71828182
So I found this great resource: here
On Linux, you probably installed ruby-build as an rbenv plugin. Updating is easy:
I checked if ruby-build was installed with
$ ruby-build --version
ruby-build 20190615-7-g0e9094b
I checked if ruby-build was associated with rbenv checking the installation path:
$ which ruby-build
/home/[username]/.rbenv/plugins/ruby-build/bin/ruby-build
git -C ~/.rbenv/plugins/ruby-build pull
as suggested in the resource this solved the problem for me.
I also noticed as I tried to install an inexistent version that the command gives the same suggestion
$ rbenv install 2.7.7
ruby-build: definition not found: 2.7.7
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build:
git -C /home/[your_user]/.rbenv/plugins/ruby-build pull