尝试安装 Rails 3.0.3 时,路径中的世界可写目录 /usr/local 不安全

发布于 2024-10-08 10:17:50 字数 690 浏览 2 评论 0原文

我正在尝试安装 Rails 3.0.3,每次都会收到以下错误:

Insecure world writable dir /usr/local in PATH, mode 040777

当我检查它是否已安装时,我收到此错误:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
 from /usr/bin/rails:18

知道我做错了什么吗?对不起,我是新人!

I am trying to install rails 3.0.3 and i get the following error every time:

Insecure world writable dir /usr/local in PATH, mode 040777

When I check to see if it installed I get this error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
 from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
 from /usr/bin/rails:18

Any idea what I am doing wrong? Sorry, I'm a newb!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

眼泪淡了忧伤 2024-10-15 10:17:50

您需要在安装之前保护该目录。用途:

chmod o-w /usr/local

执行此操作。如果这不起作用,您可能需要成为root(或以其他方式适当授权),以便您可以尝试:

sudo chmod o-w /usr/local

并输入密码。

我以前在某些软件上见过这种事情,这些软件确实希望以某种方式设置事物以确保满足其假设。无论如何,拥有全局可写目录实际上是一个坏主意,除非您知道它们的安全性不是什么大问题。

/usr/local 非常重要,您不应该允许任何人对其进行写入。

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.

记忆里有你的影子 2024-10-15 10:17:50

对于 osx,它是:sudo chmod -R ow /usr/local

For osx it's: sudo chmod -R o-w /usr/local

挽袖吟 2024-10-15 10:17:50

您将需要运行:

sudo chmod o-w -R /usr/local 

You will need to run:

sudo chmod o-w -R /usr/local 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文