Trying to install Homebrew, but I get this "fatal: cannot create directory at 'Library/ENV/pkgconfig/10.10': Permission denied" I am having issues with Brew. It was working fine, but now it's a little wonky.

Tried re-installing, but I get this error:"fatal: cannot create directory at 'Library/ENV/pkgconfig/10.10': Permission denied"

Anyone know how to fix this?

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:70: warning: Insecure world writable dir /usr/local in PATH, mode 040777
==&gt; This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1    
Press RETURN to continue or any other key to abort
==&gt; /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==&gt; Downloading and installing Homebrew...
remote: Counting objects: 207213, done.    
remote: Compressing objects: 100% (55712/55712), done.    
remote: Total 207213 (delta 150324), reused 207201 (delta 150315)    
Receiving objects: 100% (207213/207213), 43.70 MiB | 3.08 MiB/s, done.
Resolving deltas: 100% (150324/150324), done.
From https://github.com/Homebrew/homebrew
* [new branch]      master     -&gt; origin/master    
fatal: cannot create directory at 'Library/ENV/pkgconfig/10.10': Permission denied    
Failed during: git reset --hard origin/master
I would suggest go and visit 'Library/ENV/pkgconfig/10.10', if it's there, try to look at its permission, if it differs, try to delete it and re-run the installation.

It happen to me once also but it's coming from sass/grunt. Permission denied just to find out that special file was created by other user (because I copied it from somewhere) and it have overriding problems, thats why it return permission denied.

Well, that's my case, hope this little stuff might help you. Who knows :P