brew update and retried your prior step?brew doctor, fixed as many issues as possible and retried your prior step?So I found this issue when I tried to run gem update but I got this message:
/Users/OMMHOA/.rbenv/shims/gem: line 21: /usr/local/Cellar/rbenv/0.4.0/libexec/rbenv: No such file or directory
Message for ruby -v or ruby --version:
/Users/OMMHOA/.rbenv/shims/ruby: line 21: /usr/local/Cellar/rbenv/0.4.0/libexec/rbenv: No such file or directory
I checked that lib and there was only usr/local/Cellar/rbenv/1.1.0/...
After
brew update
brew upgrade
brew uninstall rbenv
brew uninstall ruby
brew uninstall ruby-build
brew install rbenv
brew install ruby
Same error message and there was no rbenv dir under /usr/local/Cellar/
After brew install ruby-build same thing.
So brew install rbenv installed the 1.1.0 for me again which resulted in the same error message. The only way to make everything work was getting rbenv 0.4.0 from here and putting it into /usr/local/Cellar/rbenv by hand.
output of brew config:
HOMEBREW_VERSION: 1.1.11
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 394f9fa0aaa5854aa52bc589708a079665dcf462
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 0fb94327ca30b492dde2e0e3b63fbe1bce356b3f
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /Users/OMMHOA/.rbenv/shims/ruby => /Users/OMMHOA
Java: 1.8.0_60
macOS: 10.12.3-x86_64
Xcode: 8.2
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11
brew doctor:
Your system is ready to brew.
After manually putting in 0.4.0:
ruby -v:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
I'm confused what's the problem? I tried reproducing the same errors and I have no luck.
brew upgrade
brew install ruby
ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
brew install rbenv
rbenv -v
rbenv 1.1.0
brew install ruby-build
ruby-build --version
ruby-build 20170201
sudo gem update
brew config
HOMEBREW_VERSION: 1.1.11-3417-g422afa0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 422afa0b49bae84e707cb3f66faf2da32cb4c462
Last commit: 2 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ee8571ae511e126438ac58a67c1f546cc488cad0
Core tap last commit: 12 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python => /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_92, 1.6.0_65-b14-468
macOS: 10.12.3-x86_64
Xcode: 8.2.1
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11
You perhaps need to run rbenv rehash. Regardless this doesn't seem to be a Homebrew issue but an rbenv one.
Most helpful comment
You perhaps need to run
rbenv rehash. Regardless this doesn't seem to be a Homebrew issue but anrbenvone.