Spread the love

First thing first: Never use sudo to install gems

Install the rbenv (https://github.com/rbenv/rbenv#readme) using homebrew (https://brew.sh/)

  1. Install rbenv: brew install rbenv
  2. Install ruby 3.1.6: rbenv install 3.1.6
  3. Set ruby version globally: rbenv global 3.1.6
  4. Open your shell initialization file : vi ~/.zshrc
  5. Ensure that you have the following line at the end of the file (for zsh): if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
  6. Save the file and then reload your shell configuration: source ~/.zshrc
  7. Perform step 4 and see if ruby version is updated

For more help use: rbenv –help. Using the help you can set the global or shell specific ruby version.

Cheers and Peace Out!!!