When you install rbenv via apt on Ubuntu 20.4 it doesn't seem to see all the versions of ruby available
e.g this happened to me:
$ rbenv install 3.1.0
ruby-build: definition not found: 3.1.0
See all available versions with `rbenv install --list'.
If the version you need is missing, try upgrading ruby-build.