I am trying to deploy my application in heroku, but I can not do anything because of this error:
Rails :: Secrets :: MissingKeyError: Missing encryption key to decrypt secrets with. Ask your team for your master key and put it in ENV ["RAILS_MASTER_KEY"]
Can someone help me?
If you try with the 'previous' method of generating secret keys, with rails secret
or rake secret
, then you'll end up with another error: ArgumentError: key must be 16 bytes
.
The easiest way to make this work with Heroku is:
heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
or just take the first 32 characters (16 bytes) from rails secret
heroku config:set RAILS_MASTER_KEY=`rake secret`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With