LoginSignup
0
0

More than 1 year has passed since last update.

Railsチュートリアル第11章:Missing host to link to! Please provide the :host parameter

Posted at

このようなエラーが

Failure/Error: <%= link_to "Activate", edit_account_activation_url(@user.activation_token,
     
     ActionView::Template::Error:
       Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true

どうやらホストが見つからないことが原因らしい。
チュートリアルの中では次の1文を追加したのだが、、、

config.action_mailer.default_url_options = { host: 'example.com' }

30分くらいかけてようやく気付いた。
追加する場所を間違っていた。

僕はここ
config/environments/development.rb

正解はここ
config/environments/test.rb

テストでエラーが出ているので環境もテストのところをいじるのは当たり前だろう

0
0
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
0
0