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 trying to bootstrap a side business.

Powered by EmailOctopus