The only way to fix this is by setting up new credentials.yml.enc and add your AWS credentials to it again. First you need to remove the existing credentials.yml.enc and then run: rails credentials:edit to create a new one.
Rails stores secrets in config/credentials.yml.enc, which is encrypted and hence cannot be edited directly. Rails uses config/master.key or alternatively looks for the environment variable ENV [“RAILS_MASTER_KEY”] to encrypt the credentials file.
Environment Specific Credentials: The `credentials` command supports passing an `–environment` option to create an environment specific override. That override will take precedence over the global `config/credentials.yml.enc` file when running in that environment.
With encrypted credentials, each environment can have its own credentials.yml.enc type of file scoped by a different naming convention. The default pattern on most rails apps is a master config/credentials.yml.enc file. This acts as a global credentials file if no other environments are present with their own credentials file.
Encrypted Credentials (config/credentials.yml.enc) Rails stores your sensitive configuration values — such as API tokens, OAuth secrets, third-party service keys, etc. — inside an encrypted …
From editing config/credentials.yml.enc to securing the master key and using environment-specific credentials, this guide has covered the essentials for beginners. To take your Rails development to the next level, consider partnering with experts like RailsCarma, a specialized Ruby on Rails development company.
Securing Rails Applications — Ruby on Rails Guides Rails stores secrets in config/credentials.yml.enc, which is encrypted and hence cannot be edited directly. Rails uses config/master.key or alternatively looks for the environment variable ENV [“RAILS_MASTER_KEY”] to encrypt the credentials file. Because the credentials file is encrypted, it can be stored in version control, as long as …
Another new file was introduced config/credentials.yml.enc, along with a config/master.key containing the key to encrypt and decrypt the credentials file. If you had previously migrated from config/secrets.yml to config/secrets.yml.enc, you would now migrate to config/credentials.yml.enc.
Couldn’t decrypt `config/credentials.yml.enc` Rails 5.2 introduced the credentials system for managing secure credentials in your application. You can edit the file with rails credentials:edit, which is pretty dope. But if you do like I did and you start your project on one machine and go to try and edit that file on a different machine after you pull down the repository from Github, it will …