warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

Xandman picture Xandman · Oct 17, 2010 · Viewed 126.5k times · Source

Every time I run this command rails server:

warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

I searched for a solution here and they said to type: chmod go-w /usr/local/bin

But I get this error:

chmod: Unable to change file mode on /usr/local/bin: Operation not permitted

I am using OS X by the way.

Answer

Jonathan Leffler picture Jonathan Leffler · Oct 17, 2010

You will need to have root access to do this. If you aren't already the administrative user, login as the administrator. Then use 'sudo' to change the permissions:

sudo chmod go-w /usr/local/bin

Obviously, that will mean you can no longer install material in /usr/local/bin except via 'sudo', but you probably shouldn't be doing that anyway.