11

just upgraded to beta El Capitan for developers.

Deniss-MBP:src me$ brew install hg
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Downloading https://mercurial.selenic.com/release/mercurial-3.4.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/mercurial-3.4.2.tar.gz
==> make PREFIX=/usr/local/Cellar/mercurial/3.4.2 install-bin
#include <stdio.h>
         ^
1 error generated.
error: command 'clang' failed with exit status 1
make: *** [build] Error 1

READ THIS: https://git.io/brew-troubleshooting

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.

Any ideas how to make it work?

Note: When I do brew doctor it says

Warning: Your Xcode (6.3.2) is outdated
Please update to Xcode 7.0.
Xcode can be updated from
  https://developer.apple.com/downloads

But I do have xcode-beta 7 installed on my computer. Not sure this is linked. Just in case

denislexic
  • 315
  • 1
  • 4
  • 9

3 Answers3

14

Check out El Capitan & Homebrew:

If /usr/local exists already:

sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local

If /usr/local does not exist:

  • Reboot into Recovery mode (Hold Cmd+R on boot) & access the Terminal.
  • In that terminal run: csrutil disable
  • Reboot back into OS X
  • Open your Terminal application and execute:

    sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
    
  • Reboot back into Recovery Mode & access the Terminal again.

  • In that terminal execute: csrutil enable
  • Reboot back into OS X & you'll be able to write to /usr/local & install Homebrew.
Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
ohho
  • 2,964
  • 10
  • 36
  • 48
11

First I recommend you go over this: https://www.reddit.com/r/apple/comments/3994os/rootless_feature_is_in_os_x_1011_and_it_disallows/

The rootless security changed a lot of things in El Capitan, other than that where does your xcode-select point to? You can use xcode-select -h to see the usage, it's very simple.

Shrewd
  • 226
  • 2
  • 2
  • You pointed me in the right direction I type `xcode-select -p` which pointed to the old version of Xcode (not the beta). So I switched the path to the Xcode-beta.app like so: `sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer` (Had to sudo or it doesn't work) – denislexic Jul 15 '15 at 11:50
  • Glad to help. another tip: `sudo xcode-select -s /Applications/Xcode-beta.app/` should work too. – Shrewd Jul 15 '15 at 11:54
3

Making a sudo chown -R $(whoami):admin /usr/local will break any agents that may be stored under /usr/local subfolders, that must be owned by root:wheel.

Note: in El Capitan, root:wheel is the default user:group that is set for /usr/local and its subfolders.

In addition, people might have 3rd party kernel extensions that must be also have root:wheel permissions (e.g. antivirus software), otherwise OS X will prevent them to be loaded.

So setting /usr/local to $(whoami) is definitely the worst idea to do.

kenorb
  • 24,736
  • 27
  • 129
  • 199
C23
  • 31
  • 1