title: Can't reinstall or uninstall Homebrew after blowing away contents of /usr/local/bin
body: <p>I removed ALL content from /usr/local/bin folder (including 'brew'). Homebrew isn't working anymore and I seem to be stuck in a limbo. When I try to install it says: </p>
  
  <blockquote>
    <p>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 <a href="https://raw.githubusercontent.com/Homebrew/install/master/uninstall" rel="nofollow noreferrer">https://raw.githubusercontent.com/Homebrew/install/master/uninstall</a>)"</p>
  </blockquote>
  
  <p>When I run the given uninstall command it says:</p>
  
  <blockquote>
    <p>Failed to locate Homebrew!</p>
  </blockquote>
  
  <p><strong>Background</strong></p>
  
  <p>The problem arose when I attempted to remove node.js by following this guide:
  <a href="https://stackoverflow.com/a/11178106/1736012">https://stackoverflow.com/a/11178106/1736012</a></p>
  
  <blockquote>
    <p>To completely uninstall node + npm is to do the following:</p>
    
    <ol>
    <li>go to /usr/local/lib and delete any node and node_modules </li>
    <li>go to /usr/local/include and delete any node and node_modules directory </li>
    <li>if you installed with brew install node, then run brew uninstall node in your terminal </li>
    <li>check your Home directory for any local or lib or
    include folders, and delete any node or node_modules from there </li>
    <li>go to /usr/local/bin and delete any node executable</li>
    </ol>
  </blockquote>
  
  <p>Especially 5 was bad! That's what led me to remove everything under /usr/local/bin. So <code>brew doctor</code> won't work (brew isn't recognized anymore). Brew worked fine before this.</p>
  
  <p><strong>What I tried</strong></p>
  
  <p>This does not work either as brew is missing:</p>
  
  <pre><code>rm -rf /usr/local/Cellar /usr/local/.git &amp;&amp; brew cleanup
  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )"
  </code></pre>
  
  <p>I tried various scripts like this one for example: <a href="https://apple.stackexchange.com/a/85481">https://apple.stackexchange.com/a/85481</a>. And this: <a href="https://gist.github.com/SteveBenner/11254428" rel="nofollow noreferrer">https://gist.github.com/SteveBenner/11254428</a>. None of them is working (both assumes that brew command is there)...</p>
  
  <p>What can I do to re install Homebrew so that it works as before??</p>