Some developers are having trouble getting up and running with homebrew after upgrading to
El Capitan, thanks to a new feature called System Integrity Protection,
users (even admins) no longer have writing permissions to system directories such as
Needless to say, Apple is smart enough to notice that devs would need
some sort of access to a lower-level folder on the system to run binaries and
root scripts, so they let
/usr/local out of the lock down. That folder by
default is owned by
root:wheel but that can easily be changed.
Running the following command should grant you permissions to write to that folder and therefore install apps using homebrew.
sudo chown -R $(whoami):admin /usr/local
If for some reason that fails, try running this:
sudo mkdir /usr/local && sudo chflags norestricted /usr/local && sudo chown -R $(whoami):admin /usr/local
The above steps should allow you to install homebrew and start using command-line apps.