title: Missing host to link to Rails heroku production
body: <p>I have an app that I am trying to put onto production. When the user signs up they have an activation email that should be sent to their email accounts but I am getting stopped with this error: </p>
  
  <pre><code>ActionView::Template::Error(Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true)
  </code></pre>
  
  <p>The problem with this error is that I have everything set up correctly in my files. For example my production.rb file inside my environments folder looks like this: </p>
  
  <pre><code>  config.action_mailer.raise_delivery_errors = true
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.default_url_options = { :host =&gt; 'secret-everglades-54128.heroku.com'}
    ActionMailer::Base.smtp_settings = {
      :address        =&gt; 'smtp.sendgrid.net',
      :port           =&gt; '587',
      :authentication =&gt; :plain,
      :user_name      =&gt; ENV['SENDGRID_USERNAME'],
      :password       =&gt; ENV['SENDGRID_PASSWORD'],
      :domain         =&gt; 'heroku.com',
      :enable_starttls_auto =&gt; true
    }
  </code></pre>
  
  <p>My enviorments.rb file looks like this: </p>
  
  <pre><code># Load the Rails application.
  require_relative 'application'
  
  # Initialize the Rails application.
  Rails.application.initialize!
  
  config.action_mailer.default_url_options = { :host =&gt; 'secret-everglades-54128.heroku.com'}
  config.action_mailer.default_url_options = { :host =&gt; 'localhost:3000' }
  </code></pre>
  
  <p>This does not make any sense to me whatsoever, if anyone could shed some light on this problem I will be very great full. </p>