我已经在谷歌上搜索了大约90分钟,但仍然没有答案.我在哪里设置default_url_options
?我已经将其设置为config.action_mailer.default_url_options
以解决其他地方的相同错误,但现在我在try 在RSpec规范中使用URL帮助程序时遇到了这个错误.我不知道它希望在哪里设置默认的URL选项.
Failure/Error: listing_url(listing).should match(/\/\d+-\w+$/)
RuntimeError:
Missing host to link to! Please provide :host parameter or set default_url_options[:host]
# ./spec/routing/listing_routing_spec.rb:9:in `block (3 levels) in <top (required)>'
这段代码与邮箱/ActionMailer无关,它只是碰巧需要一个URL而不是路径.
有什么 idea 吗?