when I ssh into the server, and run sudo RAILS_ENV=integration bundle exec rails c
I get an error stating Devise.secret_key was not set. Please add the following to your Devise initializer
. The secret_key_base
is set in the OpsWorks interface as an environment variable. Also, if I simply run sudo bundle exec rails c
(which loads the development env) it loads fine because the secrets.yml has hard coded values in the file.
So I guess my question is, how can I verify that my environment variables are making it to the application? When I deployed the app, and output Rails.application.secrets.secret_key_base
I get the development secret_key_base, not the one that is loaded in the environment. Or if there is an env variable that doesn't exist in development block in secrets.yml
the env variable returns nil
Snippet of secrets.yml below.
Thanks for any help/insight!
integration:
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>