[英]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. 我在Stackexchange上搜索解决方案后尝试了这两个命令,但它对我不起作用。 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
我正在运行OS X 10.9 Mavericks
Learn to read the error messages closely. 学习密切阅读错误消息。
Insecure world writable dir /usr in PATH
Note it's not saying /usr/local
. 注意它不是说
/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 . 伙计们,请在这里查看我的脚本解决方案。
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
修复需要几分钟
Executing the following worked for me on Mac OS X 10.11 El Capitan 在Mac OS X 10.11 El Capitan上执行以下操作对我有用
sudo chmod ow /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. 运行上面提到的chmod之后。
ls -dal /usr/local/ drwxrwxr-x 10 root wheel 340 Sep 9 15:05 /usr/local/
Which solved the problem. 这解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.