我使用this capistrano link中的代码来定义变量。
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
我已经做了相当多的搜索和阅读,但还没有得到答案。
我错过了什么?
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