rbenv not changing version

  1. Check available Ruby versions:
rbenv install -l
  1. Install the desired Ruby version:
rbenv install <version_number>
  1. Set the global Ruby version:
rbenv global <version_number>
  1. Reinitialize the shell:
exec $SHELL
  1. Verify the Ruby version:
ruby -v
  1. If the global version is not set correctly, set it again:
rbenv global <version_number>
  1. Check the Ruby version again:
ruby -v
  1. If the issue persists, check the Ruby version for the current directory:
rbenv local
  1. If a local version is set, unset it:
rbenv local --unset
  1. Check the Ruby version again:
ruby -v