I\'m running Ruby 2.5.1 and Rails 5.2.0. I ran rails s -e production
, and it gives this error:
/home/roy/.rbenv/versions/2.5.1/lib/ruby/gems/2.5
I had this similar issue when working with a Rails 5 application in production, royketelaar's answer and gib's answer
Just to add a few things:
After deleting the credentials.yml.enc
and master.key
files,
And running the command below to generate a new secret_key_base
, credentials.yml.enc
and master.key
files (my editor is VS Code and not Nano):
EDITOR="code --wait" bin/rails credentials:edit
Ensure that uncomment the following configuration in your config/environments/production.rb
file:
config.require_master_key = true
For your production environment, since the master.key
file containing the master key
which is used for decrypting the credentials.yml.enc
is not recommended to be committed to version system control, save the master key
in a RAILS_MASTER_KEY
environment variable using the figaro gem.
That's all.
I hope this helps