Rails Credentials Command

To edit the credentials file, run the credentials:edit command1:

By default, the credentials file contains the application’s secret_key_base. It can also be used to store other secrets such as access keys for external APIs.

Additionally, this command will create config/master.key if no master key is defined.

bin/rails credentials:edit
bin/rails credentials:edit --environment=production