Reputation: 129
How can i open rails "credentials.yml.enc" file in text editor to store my credentials in this file in rails 5.2?
Upvotes: 1
Views: 6550
Reputation: 1407
You need to invoke:
bin/rails credentials:edit
Use the below to open with the mentioned Editor:
EDITOR=vim rails credentials:edit
From the documentation
To edit the credentials file, run bin/rails credentials:edit. This command will create the credentials file if it does not exist. Additionally, this command will create config/master.key if no master key is defined.
Please make sure you have master key setup on config/master.key
OR on the environment variable ENV["RAILS_MASTER_KEY"]
Upvotes: 7
Reputation: 509
Like this: rails credentials:edit
and
if you want to open with another editor to open with: (for example atom)
EDITOR=atom rails credentials:edit
Upvotes: 1