Skip to content

Instantly share code, notes, and snippets.

@TechFounder
Created June 1, 2014 16:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TechFounder/1eaa0d5bbea33dab5289 to your computer and use it in GitHub Desktop.
Save TechFounder/1eaa0d5bbea33dab5289 to your computer and use it in GitHub Desktop.
secret - Figaro Gem vs Rails 4.1 These two files shows the difference in configuration between the two methods of keeping environment variables secret.
# figaro gem
# config/application.yml
stripe_publishable_key: pk_test_TLr0qqdKhm0yX1bZtKC4kFAC
stripe_secret_key: sk_test_Qbppb2nkFEzPoquOdBym0JL2
# rails 4.1
# config/secrets.yml
stripe_publishable_key: pk_test_TLr0qqdKhm0yX1bZtKC4kFAC
stripe_secret_key: sk_test_Qbppb2nkFEzPoquOdBym0JL2
# figaro gem
# config/initializers/stripe.rb
Stripe.api_key = ENV["stripe_secret_key"]
# rails 4.1
# config/initializers/stripe.rb
Stripe.api_key = Rails.application.secrets.stripe_secret_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment