# Update Rails 7 Credentials

Photo by [Towfiqu barbhuiya](https://unsplash.com/@towfiqu999999?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)

### 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
