문제

I'm deploying Rails application to server. I can easily accomplish everything if I need only production. But I need staging as well.

I launch my unicorn server with the following command:

bundle exec /home/deployer/apps/myapp/shared/bundle/ruby/2.0.0/bin/unicorn_rails \
-D -c /home/deployer/apps/myapp/shared/config/unicorn.config.rb -E staging

But regardless of my command, the server launches application with production environment.

Is there another place in my application where I should specify environment to be staging?

Thanks!

도움이 되었습니까?

해결책

Set the environment variable RAILS_ENV=staging before you run the command. You can do it on the same line even (in Bash):

$ RAILS_ENV=staging bundle exec unicorn...

You would have to have the environment set up in multiple files such as config/environments/ and config/database.yml.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top