Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 定义变量时获取sudo错误_Ruby On Rails_Variables_Sudo - Fatal编程技术网

Ruby on rails 定义变量时获取sudo错误

Ruby on rails 定义变量时获取sudo错误,ruby-on-rails,variables,sudo,Ruby On Rails,Variables,Sudo,我正在使用中的代码定义一个变量 desc "Run a tail on multiple log files at the same time" task :tail_fcgi do on roles(:app) do stream "tail -f #{shared_path}/log/fastcgi.crash.log" end end 每当我运行此命令时,我都会收到错误: ○ → cap staging t

我正在使用中的代码定义一个变量

desc "Run a tail on multiple log files at the same time"
       task :tail_fcgi do
       on  roles(:app) do
         stream "tail -f #{shared_path}/log/fastcgi.crash.log"
       end
      end
每当我运行此命令时,我都会收到错误:

    ○ → cap staging tail_fcgi
INFO[52c19335] Running /usr/bin/env sudo on myHost
DEBUG[52c19335] Command: /usr/bin/env sudo
DEBUG[52c19335]     usage: sudo [-D level] -h | -K | -k | -V
DEBUG[52c19335]     usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user
DEBUG[52c19335]                
DEBUG[52c19335]      name|#uid]
DEBUG[52c19335]     usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user
DEBUG[52c19335]                 name] [-u user name|#uid] [-g groupname|#gid] [command]
DEBUG[52c19335]     usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g
DEBUG[52c19335]                 groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]
DEBUG[52c19335]           
DEBUG[52c19335]           [VAR=value] [-i|-s] [<command>]
DEBUG[52c19335]     usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g
DEBUG[52c19335]                 groupname|#gid] [-p prompt] [-u user name|#uid] file ...
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host myHost: sudo exit status: 1

您能显示部署脚本吗?@RAJ…deploy.rb已添加。
    lock '3.2.1'

set :user, "mySelf"
set :use_sudo, false
set :deploy_via, :remote_cache
set :copy_exclude, [".*.swp", ".*.swo", ".git"]
set :branch, ENV['BRANCH'] || 'master'
set :repository, "git@code.myDomain.net:dev/scripts.git"
set :default_cluster, "CLUS"
set :cluster, "CLUS"
set :keep_releases, 20

set :repo_url, 'git@code.myDomain.net:dev/scripts.git'

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/sitemaps}

namespace :deploy do
  task :migrate do
    puts "    not doing migrate because not a Rails application."
  end
  task :finalize_update do
    puts "    not doing finalize_update because not a Rails application."
  end
  task :start do
    puts "    not doing start because not a Rails application."
  end
  task :stop do 
    puts "    not doing stop because not a Rails application."
  end
  task :restart do
    puts "    not doing restart because not a Rails application."
  end
end


namespace :deploy do
  git_filename = "config"
  production_filename = "config"


  desc "Upload new config to cluster"
  task :upload_config do
  on roles(:app) do
   end
  end
end