在我们升级到 Rails 4 和 Cap 3.1 之前,以下任务正在运行
desc 'Restart application'
task :restart do
on roles(:web), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
首先,我知道 Cap 3.1 不再隐式调用 :restart 所以我添加了以下内容:
after :publishing, :restart
但是,尝试“触摸”restart.txt 文件以使 Apache 重新加载应用程序时失败。
cap aborted!
touch stdout: Nothing written
touch stderr: Nothing written
config/deploy.rb:46:in `block (3 levels) in <top (required)>'
config/deploy.rb:45:in `block (2 levels) in <top (required)>'
Tasks: TOP => deploy:restart
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Command::Failed: touch stdout: Nothing written
touch stderr: Nothing written
>
我还需要重新启动吗?通常看起来没问题,但我想知道是否会因为找不到方法而出现问题。