Skip to content

Instantly share code, notes, and snippets.

@danman01
Created July 26, 2017 02:53
Show Gist options
  • Save danman01/a01057cf9f8d4a5bd060433dfb3ce73d to your computer and use it in GitHub Desktop.
Save danman01/a01057cf9f8d4a5bd060433dfb3ce73d to your computer and use it in GitHub Desktop.
generate secrets for rails projects
function generate_secrets {
echo SECRET_KEY_BASE_DEVELOPMENT=`bundle exec rake secret` | tee .env && echo SECRET_KEY_BASE_TEST=`bundle exec rake secret` | tee -a .env
}
@danman01
Copy link
Author

This script places new secret keys in your .env file. Put this in your ~/.bash_profile, ensure it's loaded up, then call it from within our rails project: generate_secrets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment