I simply can\'t get past the message:
Missing `secret_key_base` for \'production\' environment, set this string with `rails credentials:edit` (ArgumentError)
Secret_key_base isn't properly setting. It's a known issue not getting enough attention: https://github.com/rails/rails/issues/32947
Generate the keys with:
EDITOR=vim rails credentials:edit
Record the key.
Save in config/master.key
.
SECRET_KEY_BASE=`cat config/master.key` bin/rails assets:precompile
This is the solution I came to. I really don't like how I've been forced to put it though an environment variable. If someone has more information to bring to my attention on how master.key and such work, please do comment.
I ran into this problem when deploying my rails app to dokku using a Dockerfile. My solution:
the file config/secrets.yml
references an environment variable:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
I need to set this variable using the dokku command line (either directly on the server, or using the dokku-cli gem on my development machine):
dokku config:set SECRET_KEY_BASE=blalbalblablahblablah