Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I followed the simple instructions on Homebrew's homepage:

Paste this at a terminal prompt:
/usr/bin/ruby -e "$(curl -fsSL"

But I get the following permission errors. What is the proper way to install Homebrew on Mac OS X Lion?

$ /usr/bin/ruby -e "$(curl -fsSL"
==> This script will install:

Press enter to continue
==> /usr/bin/sudo /bin/chmod o+w /usr/local
mkdir: /usr/local/Cellar: Permission denied
mkdir: /usr/local/etc: Permission denied
mkdir: /usr/local/include: Permission denied
mkdir: /usr/local/lib: Permission denied
mkdir: /usr/local/Library: Permission denied
mkdir: /usr/local/sbin: Permission denied
mkdir: /usr/local/share: Permission denied
mkdir: /usr/local/var: Permission denied
mkdir: /usr/local/.git: Permission denied
Failed during: /bin/mkdir /usr/local/Cellar /usr/local/etc /usr/local/include /usr/local/lib /usr/local/Library /usr/local/sbin /usr/local/share /usr/local/var /usr/local/.git
share|improve this question
up vote 1 down vote accepted

Try this: sudo /usr/bin/ruby -e "$(curl -fsSL".

share|improve this answer
I think that would've worked, I was reluctant to because I didn't want to mess with Homebrew's mechanism for enabling non-sudo required installs. The problem seemed to be that Homebrew added o+w permission to /usr/local, but OS X Lion's main user is part of the group of /usr/local, so adding g+w worked. I assume I can now safely remove with sudo chmod g-w /usr/local? – at01 Aug 4 '11 at 9:29
I have to admit I just posted a knee-jerk "Permission issue, try sudo" answer. I don't actually know the answer, but I presume you could indeed try that :) – Zsub Aug 4 '11 at 9:35

I just struggled with the same problem, but instead of manually entering any commands, I used gist: 768518 to do the dirty stuff for me. Worked like a charm—and you won't need any sudoing!

The aforementioned gist (aptly described as "Fix permissions on /usr/local for Homebrew") only fixes the permissions, i.e. it doesn't install Homebrew despite the fact it is a fork of the installation script.

†) other than the required $ chmod a+x fix_homebrew.rb and $ ./fix_homebrew.rb of course

share|improve this answer

Github has a beautiful app for Mac that eliminates the painful commandline process (if the commandline is not your thing that is ;-))

share|improve this answer
It would be rather contradictory, though, if one wishes to install Homebrew while command-line not being his "thing" :-D – koiyu Sep 23 '11 at 17:35
How would GitHub for Mac help with installing Homebrew? – Daryl Spitzer Aug 9 '13 at 18:58

try these, these works for me..

ruby -e "$(curl -fsSL"
share|improve this answer
mxcl/homebrew repo is now homebrew/homebrew – konqui Dec 19 '13 at 19:04

the official oneliner from is this...

ruby -e "$(curl -fsSL"

why would you like to use a outdated gist version and not the original script???

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.