- p. 146 With Rails 6, there’s a new way to handle secrets. Instead of defining
SECRET_KEY_BASE, you’ll need to defineRAILS_MASTER_KEY.- Run
bin/rails credentials:editand save the result. This will create the value of an encryption key inconfig/master.keyand an encrypted secrets file inconfig/credentials.yml.enc. - Copy the value of the encryption key in
config/master.keyto theRAILS_MASTER_KEYenvironment variable in.env/production/web. (SECRET_KEY_BASEis obsolete–don’t define it.)
- Run
3 Likes