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