Capistrano, puma staging env keeps using production secrets
Question:
When we run bundler exec cap staging deploy
the application is still trying to pulling secrets for Production and not Staging. How can we debug this process to find why the application is pulling production secrets instead of staging secrets?
Slight back story. Our team has had a Ruby project given to us to support. We're new to Ruby, so we've been thrown in at the deep end.
The project in question is running:
- Ruby:2.3.3,
- Rails:5.1.1
- Puma:3.11
- Capistrano:3.4
When given the project there was only a production and a development environment. The client wanted a staging environment as well. So we created additional blocks in the
- config/database.yml
- config/secrets.yml
Then we created
- config/deploy/staging.rb
- config/environments/staging.rb
Hey Alex,
Have you set RAILS_ENV=staging
on the server so it knows to run the staging env in production?