2015-08-08 168 views
1

我在使用cloud9開發應用程序時遇到問題。我使用mandrill來發送電子郵件,但它給我一個配置問題。這似乎是一個無效的關鍵錯誤,但在當地的發展也具有相同配置的工程...Mandrill無效密鑰錯誤

有我的開發環境SMTP:

config.action_mailer.delivery_method = :smtp 
config.action_mailer.perform_deliveries = true 
config.action_mailer.default_url_options = { host: config.app_domain } 
config.action_mailer.smtp_settings = { 
    address: 'smtp.mandrillapp.com', 
    port: '587', 
    enable_starttls_auto: true, 
    user_name: ENV['mandrill_username'], 
    password: ENV['mandrill_password'], 
    authentication: :plain, 
    domain: ENV['mandrill_domain'] 
} 

感謝您的幫助。

+0

如果您在CLOUD9打開控制檯:'軌console'&進入'ENV [「mandrill_username」]'你收到正確的用戶名後面? – Rob

+0

@Rob是的,這是正確的。我使用figaro gem來獲取環境變量。問題不是變數。 – cotorusso

+0

這裏可能還有其他事情發生,但'無效鍵'錯誤掩蓋了潛在的問題。如果您添加config.action_mailer.raise_delivery_errors = true並重新啓動您的應用程序並嘗試再次發送,您應該能夠看到幕後發生的情況以進一步排除故障。 – terrorbox

回答