LoginSignup
17
4

More than 3 years have passed since last update.

Rails Missing host to link to! のエラーが出た時 

Last updated at Posted at 2019-05-30

Missing host to link to! Please provide the :host parameter, set default_url_options[:host]

Railsでサービスを開発しているホリカワ です。

ついに開発環境で一通り終え、本番環境にデプロイしたら上記のようなエラーが出ました。

ようは確認URLを渡すメールが送れない、というエラーです。

解決方法

https://easyramble.com/missing-host-to-link-to.html
↑こちら参考にさせていただきました、ありがとうございます。

上記のエラーは
「hostが見つからないので、default_url_options[:host]を指定してくれ」
ということなので、以下のようにすれば解決します。

config/production.rb
...
config.action_mailer.default_url_options = { host: 'example.com'}
...
17
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
4