Search code examples
ruby-on-railscredentials

Why I can not use a ready-made credentials?


I want to use ready-made credential, that are on my server.

I do EDITOR="nano --wait" bin/rails credentials:edit

Then I replace the contents of credentials.yml.enc and master.key with the ones inside these files on my server. But when I try to read credentials I get an error Couldn't decrypt config/credentials.yml.enc. Perhaps you passed the wrong key?


Solution

  • Error says it all: to use credentials files from your server, you should have same key in config/master.key file (or RAILS_MASTER_KEY env variable, depending on how you set it)