17

Im trying to start my first refinery cms project, and am already having trouble. I am trying to get imagemagick going, and am getting errors. I looked on stackoverflow about changing permissions to my profile, or the directories that have problems, also uninstalling and reinstalling, but so far no luck. I was hoping maybe someone could walk me through fixing this. Thanks so much.

 Mac-Pro:local user$ brew install imagemagick
 Error: You must `brew link jpeg' before imagemagick can be installed
 Mac-Pro:local user$ brew link jpeg
 Linking /usr/local/Cellar/jpeg/8d... 
 Error: Could not symlink file: /usr/local/Cellar/jpeg/8d/bin/wrjpgcom
 /usr/local/bin is not writable. You should change its permissions.
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
vpoola88
  • 3,669
  • 4
  • 20
  • 21
  • 1
    It looks like `/usr/local/bin` isn't writeable. Doing `ls -la /usr/local` will tell you the permissions of the `bin` directory (mine belongs to my user, in the `admin` group). – Alex Oct 21 '12 at 21:46
  • This is what I am getting when doing ls -la /usr/local drwxr-xr-x 36 root admin 1224 Oct 21 14:37 bin – vpoola88 Oct 22 '12 at 04:09
  • how do i change it to make it writeable? – vpoola88 Oct 22 '12 at 04:10
  • 8
    `sudo chown -R yourusename:admin /usr/local/bin`. This recursively changes the contents of `bin` to belong to the user `yourusername` in the group `admin`. – Alex Oct 22 '12 at 05:59
  • @Alex, your commment is awesome. Make it an answer, so we can upvote you! – Jordan Thornquest May 01 '13 at 15:02

1 Answers1

78

After encouragement, here's my comment to the question as an answer.

The problem is that the directory Homebrew is trying to use isn't writable by the user running brew. To fix this, make the directory writable by that user.

sudo chown -R yourusename:admin /usr/local/bin

This recursively changes the ownership of all objects inside the /usr/local/bin directory to the user called yourusername. It assumes that your user is in the OS X administrator group.

If you're not sure of the username of your user, you can run the command whoami.

Community
  • 1
  • 1
Alex
  • 9,313
  • 1
  • 39
  • 44
  • 1
    It might also be worth noting that the Xcode command line tools must be installed, too. – Jordan Thornquest May 02 '13 at 19:34
  • 3
    @JordanThornquest Sure, but [the tools are a prerequisite for Homebrew](https://github.com/mxcl/homebrew/wiki/Installation#requirements). Installing those tools doesn't solve the problem in question. – Alex May 02 '13 at 21:42
  • 2
    `sudo chown -R $(whoami):admin /usr/local` – A B Oct 04 '15 at 16:25