Create this file manually. Initializers are not generated on application start. They are read by Rails to configure your specific application.
Create config/initializers/stripe.rb
and fill it with the following.
Rails.configuration.stripe = {
:publishable_key => ENV['PUBLISHABLE_KEY'],
:secret_key => ENV['SECRET_KEY']
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]
Set your secret key and publishable key in your ENVs. Restart your application after the change or you won't see any difference.
I can see how you would be confused, Stripe documentation says "An initializer is a good place to set these values, which will be provided when the application is started." They mean the values you set in that file will be provided to the application instance.