Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I followed the simple instructions on Homebrew's homepage:

Paste this at a terminal prompt:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

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 https://raw.github.com/gist/323731)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...

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
add comment

5 Answers

up vote 1 down vote accepted

Try this: sudo /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)".

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
add comment

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
add comment

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
3  
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
add comment

try these, these works for me..

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
share|improve this answer
    
mxcl/homebrew repo is now homebrew/homebrew –  konqui Dec 19 '13 at 19:04
add comment

the official oneliner from brew.sh is this...

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

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

share|improve this answer
add comment

Your Answer

 
discard

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.