2016-07-03 8 views
0

私はカピストラーノをセットアップしました。カピストラーノは配備後に乗客を再起動しない限り、eveythingはうまくいきます。配備後のEveytime私はサーバにsshを入れてtouch tmp/restart.txtの中にcurrent directoryと入力しなければなりません。私は乗客を再起動するためにさまざまな方法を試みたが、何も私のために働いていない。カピストラーノはnginxを再起動しません

first attempt:

namespace :deploy do 
    task :restart do 
    on roles(:app) do 
     run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
    end 
end 

second attempt

namespace :deploy do 
    task :restart do 
    on roles(:app) do 
     within current_path do 
     execute :touch, 'tmp/restart.txt' 
     end 
    end 
    end 
end 

third attempt

namespace :deploy do 
    task :restart do 
    run "touch #{current_path}/tmp/restart.txt" 
    end 
end 

私は私と同様の問題とstackoverflowの中でコードスニペットの上に見つかりましたが、それらのどれも、サーバーを再起動されません。

私はそれはあなたのdeploy:restartタスクが実行されていないことが考えられRails 4(nginxの+乗客)

答えて

1

capistrano (3.4.0)を使用しています。

キャピストラーノ3.1.0及びより高い(Capistrano's CHANGELOGで説明したように)、自動的cap deployの終わりにdeploy:restartを実行しません。

このため、明示的deploy.rbにこれを追加することで、そうするようにカピストラーノを伝える必要があります。

after 'deploy:publishing', 'deploy:restart' 
+0

こんにちはマット屋の私 'デプロイ:restart'が実行されていません。私は仕事の後であなたの提案を試してみるつもりで、あなたは夕方にあなたを更新し続けるでしょう。おかげで – Reboot

+0

は素晴らしい仕事をした。ありがとう。 – Reboot

関連する問題