Overview
How to install Ruby using rbenv on macOS.
Steps
1. Install rbenv
brew install rbenv
2. Check available version list
rbenv install -l
3. Install a specific version
rbenv install 3.0.0
rbenv rehash
4. Add the following lines to ~/.zshrc
[[ -d ~/.rbenv ]] && \
export PATH=${HOME}/.rbenv/bin:${PATH} && \
eval "$(rbenv init -)"
5. Change the global version
rbenv global 3.0.0
6. Check the current version
rbenv version
7. Check all installed versions
rbenv versions
8. Uninstall a specific version
rbenv uninstall 3.0.0
Leave a comment