title: brew install mongodb error: Cowardly refusing to `sudo brew install' Mac OSX Lion
body: <p>I am not sure why I'm getting this error:</p>
  
  <pre><code>$ brew install mongodb
  ==&gt; Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.4.tgz
  ######################################################################## 100.0%
  Error: Permission denied - /usr/local/var/log/mongodb
  </code></pre>
  
  <p>So I try to run it with sudo:</p>
  
  <pre><code>$ sudo brew install mongodb
  Password:
  Cowardly refusing to `sudo brew install'
  </code></pre>
  
  <p>If I try to create the file myself I get this:</p>
  
  <pre><code>Error: File exists - /usr/local/var/log/mongodb
  </code></pre>
  
  <p>It gets even more interesting when you read this thread on homebrew's github about the error:</p>
  
  <p><a href="https://github.com/mxcl/homebrew/issues/9953">https://github.com/mxcl/homebrew/issues/9953</a></p>
  
  <p>They state that brew can't write the file because it's not root, then they say it's because they think it shouldn't run as root. </p>
  
  <p>These are the official install instructions, what's up?</p>
  
  <p>If you have a better suggestion for installing it, then I'll forget about homebrew.</p>