HomeBrew: Error- /usr/local/Cellar is not writable
<p>When I run the following command in my terminal:</p>

<p><code>usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</code></p>

<p>I get an error:</p>

<pre><code>/usr/local/Cellar is not writable. You should change the
ownership and permissions of /usr/local/Cellar back to your
user account:
sudo chown -R $(whoami) /usr/local/Cellar
</code></pre>

<p>Failed during: /usr/local/bin/brew update --force</p>

<p>I went through similar posts on S.O and all of them had the following commands as answer,so I ran the following commands in the terminal:</p>

<ol>
<li><code>sudo chown -R $tejas /usr/local/Cellar</code></li>
<li><code>sudo chown -R $tejas:admin /usr/local/Cellar</code></li>
<li><code>sudo chown -R $tejas /usr/local</code></li>
<li><code>sudo chown -R $tejas:admin /usr/local</code></li>
</ol>

<p>I ran the installation command after all above four command but it still gives me the error. Can someone please help me fix this. Thank you.</p>