cap production deploy
Capistrano 3.0.1 でUnicorn を起動または再起動しようとしています。次のようなものを使用して Capistrano 2.x で作業した例がいくつかあります。
namespace :unicorn do
desc "Start unicorn for this application"
task :start do
run "cd #{current_path} && bundle exec unicorn -c /etc/unicorn/myapp.conf.rb -D"
end
end
しかし、Capistrano 3.x で使用しようとするとrun
、deploy.rb
未定義のメソッド エラーが発生します。
ここに私が試したことのいくつかがあります:
# within the :deploy I created a task that I called after :finished
namespace :deploy do
...
task :unicorn do
run "cd #{current_path} && bundle exec unicorn -c /etc/unicorn/myapp.conf.rb -D"
end
after :finished, 'deploy:unicorn'
end
また、実行を :restart タスク内に入れてみました
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
execute :run, "cd #{current_path} && bundle exec unicorn -c /etc/unicorn/deployrails.conf.rb -D"
end
end
run "cd ... " then I'll get a
ローカルシェルで間違った数の引数 (0 に対して 1)`を使用した場合。
unicorn -c /etc/unicorn/deployrails.conf.rb -D
ssh された VM シェルからユニコーン プロセスを開始できます。
kill USR2 を使用して VM シェルからマスター Unicorn プロセスを強制終了できますが、プロセスが強制終了されてもエラーが発生します。その後、次を使用してプロセスを再開できますunicorn -c ...
$ kill USR2 58798
bash: kill: USR2: arguments must be process or job IDs
私はRuby、Rails、およびDeployment全般に非常に慣れていません。私は Ubuntu、Nginx、RVM、および Unicorn で VirtualBox をセットアップしています。これまでのところかなり興奮していますが、これは本当に私をいじっています。アドバイスや洞察をいただければ幸いです。