I am trying to install
brew install rbenv
Error: rbenv-rbenv already installed To install this version, first 'brew unlink rbenv'
Your system is ready to brew.
Error: No such keg: /usr/local/Cellar/rbenv
brew link rbenv
This, I was able to solve by thrashing all the junk files and folders related to rbenv still existing in the system; as
brew link rbenv wasn't working
Use command below to find any
files/folder still existing in the system.
sudo find /user/ -name "*rbenv*"
most of the issues could be because
/usr/local/opt may still have folders related to
carefully remove any listed files/folder using command
sudo rm -r <folder-listed-in-result-of-above-command>
brew install rbenv, follow any output from this command (which may suggest
brew unlink rbenv && brew link rbenv) and you should be good to go.
I do not recommend file/folder thrashing this way as it could be risky however, to be frank, this is only what worked for me.