Now that I have upgraded Yosemite to El Capitan, it is time to update Homebrew again. According to the latest docs from Homebrew, Apple has made some changes to its System Integration Protection (SIP). One of the changes is that it prevents you from writing to /usr, /System, and /bin whether you use sudo or not. This means that Homebrew will not be able to create /usr/local which is where Cellar is located. If /usr/local already exists then you will need to change the ownership back to your user account because El Capitan would have reset all sub folders in /usr to root:wheel.
If you do not have /usr/local then you will need to disable csrutil, create /usr/local, then enable csrutil.
For more information follow the link below: