A. ) Temporary Solution

If you installed new version of ruby, but ruby -v still showing old version.

  1. Install rbenv by following commnd:

$ brew install rbenv

$ export PATH=”$HOME/.rbenv/bin:$PATH”

$ eval “$(rbenv init -)”

Check ruby version by ruby -v command

B. ) Permanent Solution

  • Open up Terminal.
  • Run the following command: sudo nano /etc/paths
  • Enter your password, when prompted.
  • Go to the bottom of the file, add $HOME/.rbenv/bin at the top of file
  • Hit control-x to quit.
  • $ vi ~/.zshrc
  • Add eval “$(rbenv init -)” code in file, if it doesn’t exists then create new one.
  • Check ruby -v after open new terminal

Leave a Reply

Your email address will not be published. Required fields are marked *