Ask your team for your master key and put it in ENV["RAILS_MASTER_KEY"] on heroku deploy

Viewed 8351

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?

3 Answers

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

Related