Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depend on deploy:set_rails_env for unicorn:start (or load:defaults) #16

Open
eLod opened this issue Mar 8, 2014 · 7 comments
Open

Depend on deploy:set_rails_env for unicorn:start (or load:defaults) #16

eLod opened this issue Mar 8, 2014 · 7 comments

Comments

@eLod
Copy link

eLod commented Mar 8, 2014

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.

@seapy
Copy link

seapy commented Mar 10, 2014

+1
when i only unicorn stop and start. RAILS_ENV is not set and can't start unicorn.

@eLod solution is works.

@DavidBennettPIO
Copy link
Contributor

+1

I didn’t notice before as I always set it manually.

set :rails_env, "production"

@jmcomets
Copy link

jmcomets commented Jun 6, 2014

Same problem here, I tried @eLod's solution and it worked.

@amw
Copy link

amw commented Sep 8, 2014

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.

@aurels
Copy link

aurels commented Sep 15, 2014

Hi,

For me, whatever I do, it ends up with -E deployment :-/

@amw
Copy link

amw commented Sep 15, 2014

That's correct. -E is for setting RACK_ENV. Most setups use something like RAILS_ENV=production unicorn -E deployment.

@aurels
Copy link

aurels commented Sep 15, 2014

That's strange, setting :unicorn_rack_env does the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants