Ask A Question

Notifications

You’re not receiving notifications from this thread.

Capistrano, puma staging env keeps using production secrets

Alex White asked in Rails

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
Reply

Hey Alex,

Have you set RAILS_ENV=staging on the server so it knows to run the staging env in production?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.