2017-10-04 81 views
0

我不是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配置中找不到任何示例。

任何人都可以幫助我嗎?

+0

您不需要在'application.rb'中添加郵件配置。 Redmine的'configuration.yml'就足夠了。屬於您的錯誤消息的堆棧跟蹤將有助於確定出錯的地方。 – jkraemer

+0

是的,但仍然有相同的錯誤。即使我使用默認的'application.rb'並在'configuration.yml'中配置電子郵件,仍然有相同的錯誤,redmine將無法啓動。 – KacproSo

回答

0

確保您configuration.yml正確縮進(使用每縮進級別2個空格):

production: 
    email_delivery: 
    delivery_method: :smtp 
    smtp_settings: 
     address: 'example.org' 
     port: 587 

SMTP設置(地址,端口等),必須在smtp_settings哈希鍵。從你得到的錯誤,我會說他們是在smtp_settings相同的水平上,這是錯誤的關鍵。

+0

該死的,我更新雖然這個空間有這麼重要。謝謝jkraemer。這是解決的問題。 – KacproSo

相關問題