运行brew会生成警告
我在 OS X 10.6.5 上安装了最新的 Homebrew
运行任何命令都会生成此警告:
/usr/local/Library/Homebrew/global.rb:34:警告:路径中不安全的世界可写目录 /usr/local/bin,模式 040777
为什么我收到此警告?以及如何补救?
I installed the latest Homebrew on OS X 10.6.5
Running any command generates this warning:
/usr/local/Library/Homebrew/global.rb:34: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Why I'm getting this warning? and how to remedy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,只是用这 3 个命令修复了它,大致取自 Homebrew 安装脚本:
I had the same problem and just fixed it with these 3 commands, roughly taken from Homebrew installation script:
首先,有两个brew 命令在调试问题时很有帮助。它们是:
其次,Homebrew 告诉您
/usr/local/bin
对谁可以写入该目录的设置过于宽松——这是一个潜在的安全问题。要解决此问题,您可以将权限重置回 Homebrew 预期的权限。如果您在尝试执行此操作时遇到错误,则可能意味着您的 /usr/local 目录(和子目录)属于错误的用户。如果是这种情况,我会考虑删除您的 /usr/local 目录并重新安装 Homebrew < em>正确。或者,您可以通过在最后一个命令前加上 sudo 并输入您的管理员密码来覆盖错误:
First, there are two brew commands that are helpful when debugging problems. They are:
Second, Homebrew is telling you that
/usr/local/bin
is set to be too permissive in who can write to that directory -- a potential security problem. To remedy this, you can reset your permissions back to what Homebrew intended.If you get an error while trying to do this, it may mean that your /usr/local directory (and subdirectories) are owned by the wrong user. If that's the case, I would consider deleting your /usr/local directory and reinstalling Homebrew correctly. Alternatively, you can override the error by prefixing the last command with sudo and entering your admin password:
这是 ruby 的一项安全功能,您可以通过运行以下命令来更改目录 /usr/local/bin 的权限以消除此问题:
并在提示符下输入密码。
您不需要需要更改所有权,并且也不应该按照 Ryan 建议删除 /usr/local(这将要求您重建迄今为止已完成的所有内容),该目录由 root 拥有,这是通常的方式。
This is a security feature of ruby, you can change permissions on the directory /usr/local/bin to get rid of this by running:
and entering your password on the prompt.
You do not need to change ownership and neither should delete /usr/local as Ryan suggested (that would require you to rebuild everything you´ve accomplished so far), the directory is owned by root and this is the usual way.