Reputation: 111
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?
Upvotes: 9
Views: 9010
Reputation: 798
there are two ways to solve this problem.
rake secret
.Upvotes: 0
Reputation: 1245
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
Upvotes: 8