How to store credentials and secrets in Ruby on Rails 6
1 min read

How to store credentials and secrets in Ruby on Rails 6

Ruby on Rails has a support for storing credentials and secrets with rails credentials:edit

export EDITOR="code --wait" # or export EDITOR=vim
# Create global credentials at config/credentials.yml.enc and config/master.key
rails credentials:edit
 
# Create credentials for a given environment at config/credentials/<environment>.yml.enc
# It takes precedence over global credentials
rails credentials:edit --environment production
rails credentials:edit --environment development

Follow my journey learning Ruby on Rails and trying to bootstrap a business.

Powered by EmailOctopus