I had the same error here MacOSX 10.11 - it seems ruby checks to see if any directory (including the parents) in the path are world writable. In my case there wasn't a /usr/local/bin present as nothing had created it.
Run this command in your terminal.Try this sudo chmod 775 /usr/local After this if you have any password on your mac , then you have to enter the password . Now this issue will be fix.