0

I tried to deploy my application on VPS but got an error:

ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit`

I added my secret_key_base to the environment variable:

export SECRET_KEY_BASE=<my secret key>

but am getting the same error.

secrets.production.yml:

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
SsPay
  • 161
  • 9
  • Did you tried this solution here: https://stackoverflow.com/questions/23180650/how-to-solve-error-missing-secret-key-base-for-production-environment-rai Or this: https://stackoverflow.com/questions/51466887/missing-secret-key-base-for-production-environment – Nezir Jan 22 '20 at 19:36

1 Answers1

0

If you are using Rails >=5.2, you should run this command:

rails credentials:edit

The command will create the config/master.key and config/credentials.yml.enc files.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303