Using named routes in any of my application's mailers is raising this error:
ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
This isn't happening all the time and I can't reproduce locally in either development or production mode.
If I open a console in production, I can confirm that the default host is configured:
ActionMailer::Base.default_url_options
=> {:host=>"thehost.com"}
Rails.application.config.action_mailer.default_url_options
=> {:host=>"thehost.com"}
Spree::Core::Engine.config.action_mailer.default_url_options
=> {:host=>"thehost.com"}
All the named routes are being called through Spree's routing proxy:
<%= spree.my_route_url %>
I have the following in config/environments/production.rb
config.action_mailer.default_url_options = { :host => "thehost.com" }
This may be redundant since Spree also sets it from the :site_url preference (which I have configured correctly)
ActionMailer::Base.default_url_options[:host] = Spree::Config[:site_url]
(from mail_settings.rb)
Spree is version 1-0-stable Rails 3.1.3 Ruby 1.9.3