config/initializers/stripe.rb sets that value, which it gets from the process environment (its a unix thing).

dotenv sets the environment for you by reading the .env file. Copying env.template to .env and putting the values from stripe in there should make everything just work. (For production you'll need to put those things into your heroku environment as well.)