capistrano3-unicorn
capistrano3-unicorn copied to clipboard
Depend on `deploy:set_rails_env` for `unicorn:start` (or `load:defaults`)
I'm not sure if I missed something but if I run bundle exec cap production unicorn:start it fails because rails_env is not set. With bundle exec cap production deploy:set_rails_env unicorn:start it works as expected.
+1 when i only unicorn stop and start. RAILS_ENV is not set and can't start unicorn.
@eLod solution is works.
+1
I didn’t notice before as I always set it manually.
set :rails_env, "production"
Same problem here, I tried @eLod's solution and it worked.
This won't be needed after capistrano-rails 1.1.2 is released as it adds these lines to it's task definitions:
Capistrano::DSL.stages.each do |stage|
after stage, "deploy:set_rails_env"
end
This causes Rails env variables to be added at the beginning of each stage.
Hi,
For me, whatever I do, it ends up with -E deployment :-/
That's correct. -E is for setting RACK_ENV. Most setups use something like RAILS_ENV=production unicorn -E deployment.
That's strange, setting :unicorn_rack_env does the trick for me.