Update Rails 7 Credentials

Photo by Towfiqu barbhuiya on Unsplash

Update Credentials of Current Environment

To edit Rails 7 credentials in the preferred editor, run:

EDITOR=<editor> rails credentials:edit

Replace <editor> with editor name.

For example:

# nano
EDITOR=nano rails credentials:edit
# mate
EDITOR="mate --wait" rails credentials:edit

Update Credentials of Other Environment

To edit production’s credentials, run:

EDITOR=nano rails credentials:edit --environment <env_name>

Replace <env_name>with needed environment name.

For example:

# production:
EDITOR=nano rails credentials:edit --environment production
# staging
EDITOR=nano rails credentials:edit --environment staging

--

--