我刚安装了OSX El Capitan并开始遇到Homebrew的问题。我按照这些说明进行操作:https://ohthehugemanatee.org/blog/2015/10/01/how-i-got-el-capitain-working-with-my-developer-tools/,但没有帮助。然后我尝试了更改权限、硬重置和再次拉取源代码等操作,重新安装Homebrew等等,但错误仍然存在。我可以运行brew doctor等命令,但无法运行brew update(整个问题始于我运行brew doctor并推荐我运行brew update)。无论如何,这是我运行brew update时显示的内容:
这是update.sh中第58行及其以下内容的内容:mv: 无法重命名/usr/local/Library/Taps/homebrew-versions为/usr/local/Library/Taps/homebrew/homebrew-versions/homebrew-versions,因为没有此文件或目录/usr/local/Library/Homebrew/cmd/update.sh: 第58行: ${#${tap_dir_basename//[^-]}}: 错误的替换
if [[ ${#${tap_dir_basename//[^\-]}} -gt 1 ]]
then
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
fi
else
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>. " >&2
echo "$tap_dir is an incorrect Tap path." >&2
echo "So you may need to rename it to $HOMEBREW_LIBRARY/Taps/<someuser>/homebrew-<sometap> manually." >&2
fi
我已经没有更多的想法了。在谷歌上搜索时,我发现了同一领域的其他问题,但从未遇到过这个确切的问题。其他人已经尝试了我已经尝试过的解决方法。有人以前见过这种情况吗?
编辑:问题已经解决。以下是解决方法:
cd /usr/local
git checkout master
git fetch origin
git reset --hard origin/master
brew update