Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve Insecure world writable dir /usr in PATH,mode 040777 warning on Ruby?

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb:213: warning: Insecure world writable dir /usr in PATH, mode 040777

I've tried these two commands after searching for solutions on Stackexchange, but it didn't work for me. It still shows me the warning which I've pasted above.

sudo chmod 775 /usr/local

sudo chmod go-w /usr/local/bin

How do I fix this warning message? I'm running OS X 10.9 Mavericks

like image 982
Jash Jacob Avatar asked Nov 03 '14 09:11

Jash Jacob


3 Answers

Learn to read the error messages closely.

Insecure world writable dir /usr in PATH

Note it's not saying /usr/local.

To confirm this diagnosis, use

 ls -ld /usr
 drwxrwxrwx  14 ownerID  groupID     4096 Dec 10  2010 /usr
 #-------^-  is the world-writeable  part

As you know, you can fix it with

 sudo chmod 755 /usr

Edit

Folks, See my scripted solution over here.

like image 53
shellter Avatar answered Nov 09 '22 19:11

shellter


I fixed this by using Disk Utility to repair disk permissions.

Open the Disk Utility application and select the disk your system is installed on. Then you can select "Repair Disk Permissions" from the First Aid tab. Repair will take a couple of minutes

like image 11
quido Avatar answered Nov 09 '22 18:11

quido


Executing the following worked for me on Mac OS X 10.11 El Capitan

sudo chmod o-w /usr/local

The error occured when loading a vagrant as follows;

vagrant status /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/pre-rubygems.rb:31: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /opt/vagrant/embedded/gems/gems/bundler-1.10.6/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local in PATH, mode 040777 ls -dal /usr/local/ drwxrwxrwx 10 root wheel 340 Sep 9 15:05 /usr/local/

After running the chmod mentioned above.

ls -dal /usr/local/ drwxrwxr-x 10 root wheel 340 Sep 9 15:05 /usr/local/

Which solved the problem.

like image 3
Mikel Avatar answered Nov 09 '22 20:11

Mikel