My ruby on rails action mailer отлично работает в среде разработки, но в рабочей среде он сохраняет бросок:
ActionView::Template::Error: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
Моя конфигурация конфигурации
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:port => xxx,
:address => 'smtp.example.org',
:user_name => '[email protected]',
:password => 'xxxxxxxx',
:domain => 'xxxxxx.com',
:authentication => :plain,
}
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
Мой конфигурационный файл
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:port => 587,
:address => 'smtp.example.org',
:user_name => '[email protected]',
:password => 'xxxxxx',
:domain => 'example.com',
:authentication => :plain,
}
config.action_mailer.default_url_options = { :host => 'example.com' }
Мои другие среды:
ruby 2.1.1
rails 4.0.3
sidekiq
devise
devise-async
Я пробовал:
-
Добавьте в файл инициализации следующее:
ActionMailer::Base.default_url_options[:host] = "example.com"
-
Этот ответ здесь
Ни один из них не работает.