Fazal Ur Rehman Fazal
Fazal Ur Rehman Fazal

Reputation: 129

Opening Ruby on rails credentials encrypted file in editor

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

Answers (2)

user11350468
user11350468

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

Gaeguri
Gaeguri

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

Related Questions