Redmine中的电子邮件配置 - 未定义的方法`地址='
问题描述:
我不是Ruby和Redmine的专家,但我试图在redmine中配置电子邮件通知。 管理平台3.4版 红宝石2.3.3p222 的Phusion客运5.1.7Redmine中的电子邮件配置 - 未定义的方法`地址='
在configuration.yml我
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "xxxx.pl"
port: 587
authentication: :plain
domain: 'redmine.xxx.pl'
user_name: '[email protected]'
password: '......'
但我得到这个错误:
Error ID: 54731089
Error details saved to: /tmp/passenger-error-WqNBmN.html
Message from application: undefined method `address=' for ActionMailer::Base:Class (NoMethodError)
我搜索点点,弄清楚,我在application.rb文件中缺少方法。
所以在管理平台的config/application.rb中我添加类似的东西:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "xxx.pl",
port: 587,
user_name: '[email protected]',
password: '.....',
authentication: :plain
}
但仍然有同样的错误。不幸的是,我在Redmine配置中找不到任何示例。
任何人都可以帮助我吗?
答
确保您configuration.yml
正确缩进(使用每缩进级别2个空格):
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: 'example.org'
port: 587
SMTP设置(地址,端口等),必须在smtp_settings
哈希键。从你得到的错误,我会说他们是在smtp_settings
相同的水平上,这是错误的关键。
+0
该死的,我更新虽然这个空间有这么重要。谢谢jkraemer。这是解决的问题。 – KacproSo
您不需要在'application.rb'中添加邮件配置。 Redmine的'configuration.yml'就足够了。属于您的错误消息的堆栈跟踪将有助于确定出错的地方。 – jkraemer
是的,但仍然有相同的错误。即使我使用默认的'application.rb'并在'configuration.yml'中配置电子邮件,仍然有相同的错误,redmine将无法启动。 – KacproSo