From a06a579e0fa9947b99a54464a1f024fcbc17723f Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Tue, 29 Sep 2015 17:52:29 +0200 Subject: [PATCH 1/2] execute unicorn command directly --- lib/capistrano3/tasks/unicorn.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capistrano3/tasks/unicorn.rake b/lib/capistrano3/tasks/unicorn.rake index 21a8a1f..5e7b96b 100644 --- a/lib/capistrano3/tasks/unicorn.rake +++ b/lib/capistrano3/tasks/unicorn.rake @@ -18,7 +18,7 @@ namespace :unicorn do info "unicorn is running..." else with rails_env: fetch(:rails_env) do - execute :bundle, "exec unicorn", "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_rack_env), "-D", fetch(:unicorn_options) + execute :unicorn, "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_rack_env), "-D", fetch(:unicorn_options) end end end From e4afcd6f0a7a75c41a42c9cc7ba52548bfbe3d77 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Tue, 29 Sep 2015 18:11:14 +0200 Subject: [PATCH 2/2] add documentation for bundler usage --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 234d817..f698c4b 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,14 @@ This is a capistrano v3 plugin that integrates Unicorn tasks into capistrano dep ### Gotchas -- The `unicorn:start` task invokes unicorn as `bundle exec unicorn`. - - When running tasks not during a full deployment, you may need to run the `rvm:hook`: `cap production rvm:hook unicorn:start` +- To use unicorn with bundler, you'll have to add the `capistrano-bundler` gem, and add the unicorn command to the bundle bins: + + `set :bundle_bins, fetch(:bundle_bins, []).push('unicorn')` + ### Conventions You can override the defaults by `set :unicorn_example, value` in the `config/deploy.rb` or `config/deploy/ENVIRONMENT.rb` capistrano deployment files.