You must upgrade ruby-build to the latest version, ruby-build is the rbenv plugin that provides the rbenv install command to compile and install different versions of Ruby on UNIX-like systems.
Using the Homebrew Package Manager:
brew upgrade ruby-build --HEAD
If ruby-build-HEAD is already installed, try reinstalling it
brew reinstall ruby-build --HEAD
You can find the current stable Ruby version number at:
https://www.ruby-lang.org/en/downloads/
Then use rbenv to view an updated list of available options:
rbenv install
Install the latest stable version as shown below (replace 2.2.2 with your version):
rbenv install 2.2.2 rbenv rehash
To view and check all installed versions:
rbenv versions
To install the global ruby ββversion (in this case 2.2.2):
rbenv global 2.2.2
Hope this helps you and everyone else who faces a similar situation in the future.
source share