【发布时间】:2015-07-08 03:46:17
【问题描述】:
我对如何在 Rails 4.2 中正确使用 figaro 感到困惑。所以在 application.yml (检查到 .gitignore)中,我有这个:
secret_key_base: 123456
然后在 secrets.yml 中,我有这个:
development:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
根据我阅读的所有内容,gem 应该处理设置凭据的 ENV 部分。为什么这不起作用?
编辑 1:
在 application.yml 我有:mandrill_user_name: email@example.com 和 mandrill_password: 1234567890
在 development.rb 我有:
config.action_mailer.default_url_options = { :host => "localhost:3000" }
config.action_mailer.smtp_settings = {
address: "smtp.mandrillapp.com",
port: 587,
domain: "localhost:3000",
authentication: "plain",
enable_starttls_auto: true,
user_name: ENV["mandrill_user_name"],
password: ENV["mandrill_password"]
}
application.yml 不应该处理这个吗?
【问题讨论】:
标签: ruby-on-rails actionmailer