warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
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.
Getting the warning Insecure world writable dir /home/chance in PATH, mode 040777 for rails and gem
If you tried sudo chmod go-w /usr/local/bin
from the other answer, try:
chmod go-w /home/chance
instead.
What seems to have happened is that somehow your home directory (/home/chance
) has been added to your $PATH
(the list of directories the OS searches when trying to find an executable to launch) and has also had its permissions changed so that anyone can write to it. This is potential a security problem, as another user could put an executable into this directory which you could accidentally launch. Ruby notices this and issues the warning.
This command changes the permissions of the directory so that it is no longer world writable.
In unix, file permissions are specified for three categories, the file owner (user), the group of the file (group), and everyone else (other). (See Google for more on unix file permissions).
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
In the other answer the directory that was causing the problem was /usr/local/bin
, which is owned by root so sudo
is required to change permissions on it. /home/chance
is your home directory which is owned by the chance
user who can change permissions on it - no sudo
required.
Insecure world writable dir /usr/local in PATH when trying to install Rails 3.0.3
You need to secure that directory before the install. Use:
chmod o-w /usr/local
to do this. If that doesn't work, the you probably need to be root
(or otherwise suitably empowered) so you can try:
sudo chmod o-w /usr/local
and enter your password.
I've seen this sort of thing before on some software which really wants things set up in a certain way to ensure that its assumptions are met. In any case, it's actually a bad idea to have world writable directories except when you know security on them is not a big deal.
/usr/local
is important enough that you shouldn't allow anyone to write to it.
warning: Insecure world writable dir /usr in PATH, mode 040777
To eliminate this particular error, just execute
sudo chmod 755 /usr
But in general, world-writable /usr
directory means there are problems in your system.
How to fix insecure world error?
chmod go-w /Users/mitchmurphy/
wasn't enough because it only changed the permissions on your home folder, but not all the folders under it.
You can do chmod -R go-w /Users/mitchmurphy/.rbenv
which will remove write permissions to all the folders inside your rbenv directory recursively (the -R option) from everyone except you.
Explanation:-R
- recursive (apply to all folders under this one)go
- the 'people' it'd affect. In this case 'group' and 'others' (file and directory permissions are separated into three cases, owner group and others)-w
- this just means 'remove write'
warning: Insecure world writable dir when I run a ruby or gem command
Just chmod go-w /opt/local/bin
at a shell prompt (depending on permissions you may need to sudo
to do that).
Related Topics
How to Get the Width of Terminal Window in Ruby
Rails Routing (Root :To => ...)
How to Access a Ruby Module Method
Sorting: Sort Array Based on Multiple Conditions in Ruby
Code to Generate Gaussian (Normally Distributed) Random Numbers in Ruby
Rails: Respond_To JSON and HTML
Rails -- Create and Create! Methods, Ror 3 Tutorial
How to Validate Associated Model Id
How to Sort a Hash by Value in Descending Order and Output a Hash in Ruby
Rails: How to Write Tests for a Ruby Module
Rails: How to Show User's "Last Seen At" Time
How to Introspect Things in Ruby
Ruby on Rails: Provide VS Content_For
How to Call Applicationcontroller Methods from Applicationhelper
How to Test a Ruby Application Which Uses Mechanize
Ruby: How to Pass All Parameters and Blocks Received by One Method to Another