https://rubygems.org/gems/figaro
https://github.com/bkeepers/dotenv
figaro 用法:
bundle exec figaro install
然后就会生成 config/application.yml
# Add configuration values here, as shown below.
#
# pusher_app_id: "294"
# pusher_key: 7381a978f7dd7f79a1117
# pusher_secret: abdc3b896a0ffb85d7373
# stripe_api_key: sk_test_2J0l093xO7yW72XUYJHE4Dv2r
# stripe_publishable_key: pk_test_ro9jV5SN2wGb1yYlQfzG17LHK
#
# production:
# stripe_api_key: sk_live_EeHnL644i16zo4Iyq4v1KdV9H
# stripe_publishable_key: pk_live_9lcthxp2SIHbGwmdO941O1XVU
使用就是ENV['key']
标签:publishable,pusher,rails,figaro,live,stripe,key,dotenv From: https://blog.51cto.com/u_15976398/6166422