Insecure world writable dir on rails

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

I found this error at running any rails command, this is due UNIX doesn’t like the word writable on that path; the solution:

sudo chmod go-w /usr/local/bin

So breaking down the command above:

chmod – change the ‘mode’ of the file (i.e. its permissions)

go – for group(g) and others(o)

-w – (minus w) remove write permission

/home/chance – the file (or directory) in question