Brew update does not work - error with poor replacement for update.sh

I just installed OSX El Capitan and started experiencing problems with Homebrew. First, I followed these instructions: https://ohthehugemanatee.org/blog/2015/10/01/how-i-got-el-capitain-working-with-my-developer-tools/

It did not help. Then I tried things like changing permissions, hard reset and stretching the original, removing Homebrew and installing it again, etc. The error remains. I can start the brew doctor, etc., but I can not start the brew update (the whole problem was due to the fact that I started the brew doctor and recommended to start the brew update). In any case, what is displayed when I run brew update:

mv: rename / usr / local / Library / Taps / homebrew versions to / USR / local / Library / Taps / homebrew / homebrew-version / homebrew-version: There is no such file or directory / usr / local / Library / Homebrew /cmd/update.sh: line 58: $ {# $ {tap_dir_basename // [^ -]}}: incorrect replacement

And here is the contents of line 58 and the following in update.sh:

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

I have no ideas. Parsing it, I found other problems in the same area, but this is not a problem. Others were resolved by actions that I have already tried. Has anyone seen this before?

EDIT: The problem is resolved. Here's the fix:

cd /usr/local
git checkout master
git fetch origin
git reset --hard origin/master
brew update
+4
source share
1 answer

When conducting the above answer, mark as the answer:

cd /usr/local
git checkout master
git fetch origin
git reset --hard origin/master
brew update
0
source

All Articles