我似乎无法弄清楚我的Mac上的Homebrew / Ruby环境发生了什么。
这是我当前的输出/状态
$ xcode-select --install
xcode-select: note: install requested for command line developer tools
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc Library LICENSE.txt mysql mysql-5.7.11-osx10.9-x86_64 README.md share var .git .github .gitignore
$ brew doctor
/usr/local/Library/brew.sh: line 172: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 172: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
$ brew update
/usr/local/Library/brew.sh: line 172: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 172: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
$ brew list
/usr/local/Library/brew.sh: line 172: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 172: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
$ brew install rbenv ruby-build
/usr/local/Library/brew.sh: line 172: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 172: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
我甚至尝试卸载并重新安装Homebrew,它运行良好,但在我完成时仍然是相同的情况。
我打开了usr/local/Library/brew.sh
并找到了以下内容:
if [[ -z "$HOMEBREW_RUBY_PATH" ]]
then
if [[ -n "$HOMEBREW_OSX" ]]
then
HOMEBREW_RUBY_PATH="/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby"
else
HOMEBREW_RUBY_PATH="$(which ruby)"
fi
fi
我尝试用
替换它if [[ -z "$HOMEBREW_RUBY_PATH" ]]
then
if [[ -n "$HOMEBREW_OSX" ]]
then
HOMEBREW_RUBY_PATH="$(which ruby)"
else
HOMEBREW_RUBY_PATH="$(which ruby)"
fi
fi
然后去了终点站:
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
$ brew update
To restore the stashed changes to /usr/local run:
'cd /usr/local && git stash pop'
/usr/local/Library/brew.sh: line 174: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: No such file or directory
/usr/local/Library/brew.sh: line 174: exec: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby: cannot execute: No such file or directory
我如何获得Ruby& Homebrew安装了?