我试过了这但它不起作用,似乎适用于 osx。我有一个全新安装的 Ubuntu 10.10 (x64),其中有 rvm、rails 3 和 ruby 1.9.2。我有一个新的 rails 应用程序,但使用 gem 或 rails 会导致以下警告(有延迟)。
$ 轨道-v
/home/chance/.rvm/gems/ruby-1.9.2-p180@global/gems/railties-3.0.5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /home/chance in PATH, mode 040777
/home/chance/.rvm/gems/ruby-1.9.2-p180@global/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /home/chance in PATH, mode 040777
Rails 3.0.5
$宝石-v
/home/chance/.rvm/rubies/ruby-1.9.2-p180/bin/gem:4: warning: Insecure world writable dir /home/chance in PATH, mode 040777
1.6.2
以防万一,这是我的 Gemfile:
source 'http://rubygems.org'
gem 'rails'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem "haml"
gem "formtastic"
gem "will_paginate"
gem "devise"
gem "delayed_job"
gem "whenever"
gem "memcache-client"
gem "capistrano"
group :testing do
gem "rspec"
gem "rspec-rails"
gem "autotest-standalone"
gem "autotest-rails"
gem "autotest-growl"
gem "mocha"
gem "shoulda"
gem "factory_girl_rails"
end
group :development do
gem "cheat"
gem "bullet"
gem "ruby-growl"
end
答案1
该消息表明该目录/home/chance
可供所有人写入,这是一个潜在的安全漏洞。这可能允许恶意用户将文件放入该目录中,然后目录的所有者可能会意外使用。
要修复,请从中删除全球可写位/home/chance
:
$ chmod o-w /home/chance
如果您不是 的所有者/home/chance
,则需要以 root 身份通过 sudo 执行此操作:
$ sudo chmod o-w /home/chance