Capistrano检查权限始终不可写

时间:2016-07-22 10:06:01

标签: ruby-on-rails linux capistrano

我使用capistrano检查我的deploy_to路径的权限,它总是输出path is not writable on mydomain.com,即使我给它777权利。

ls -ld /srv/www/
drwxrwxrwx 2 root root 4096 Jul 20 15:24 /srv/www/

这是任务:

desc "Check that we can access everything"
  task :check_write_permissions do
    on roles(:all) do |host|
      if test("[ -w #{fetch(:deploy_to)} ]")
        info "#{fetch(:deploy_to)} is writable on #{host}"
      else
        error "#{fetch(:deploy_to)} is not writable on #{host}"
      end
    end
  end

1 个答案:

答案 0 :(得分:0)

我在deploy_tostaging.rb设置deploy.rb,前者覆盖后者。