简体   繁体   English

如何在PATH中解决不安全的世界可写dir / usr,在Ruby上模式040777警告?

[英]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.

相关问题 警告:PATH模式040777下不安全的世界可写目录/ usr - warning: Insecure world writable dir /usr in PATH, mode 040777 在PATH中获取警告“不安全世界可写dir / home / chance”,模式040777用于rails和gem - Getting the warning “Insecure world writable dir /home/chance ” in PATH, mode 040777 for rails and gem 警告:不安全的世界可写目录…/osx/bin 在 PATH,模式 040777 与 Homebrew - warning: Insecure world writable dir …/osx/bin in PATH, mode 040777 with Homebrew 运行 Ruby 命令时,PATH 中不安全的世界可写目录/用户/用户名,模式 040777 - Insecure world writable dir /Users/username in PATH, mode 040777 when running Ruby commands 运行“rails s”后如何修复“路径中不安全的世界可写目录/mnt/c,模式040777”错误 - How to fix "Insecure world writable dir /mnt/c in PATH, mode 040777" error after running "rails s" 禁止警告“不安全的世界可写目录/some/dir/” - Suppress warning “Insecure world writable dir /some/dir/” 运行ruby脚本时出现错误的“ PATH中不安全的世界可写dir foo” - Erroneous “Insecure world writable dir foo in PATH” when running ruby script 耙任务提示不安全的可写目录 - Rake tasks prompt insecure writable dir 项目外部的路径,Ruby Dir - Path outside of project, Ruby Dir Ruby目录路径从路径中排除目录 - Ruby dir path exclude directory from path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM