我想在heroku上推送我的应用程序.我还在开发中.我使用了可确认模块的设计.
当我尝试使用heroku控制台添加用户时出现此错误:
Missing host to link to! Please provide :host parameter or set default_url_options[:host]
Run Code Online (Sandbox Code Playgroud)
在测试和开发环境中,我有以下行:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
Run Code Online (Sandbox Code Playgroud)
我没有在生产环境中设置一些东西.
我试过推
config.action_mailer.default_url_options = { :host => 'mywebsitename.com' }
config.action_mailer.default_url_options = { :host => 'heroku.mywebsitename.com' }
Run Code Online (Sandbox Code Playgroud)
但它也不起作用..
我在网上看到它可能与ActionMailer有关,但我不知道我要配置什么.非常感谢你的想法!
嗨,
为了在我推动heroku时不让我的应用程序崩溃,我把它放在我的env/test.rb和我的env/dev.rb(不在env.rb中,我认为这是因为它是rails 3应用程序)
config.action_mailer.default_url_options = { :host => 'yourapp.heroku.com' }
Run Code Online (Sandbox Code Playgroud)
但是当我尝试在heroku控制台中创建用户时:
User.create(:username => "test", :email => "test@test.com", :password => "test1234", :password_confirmation => "test1234", :confirmed_at => "2010-11-03 14:11:15.520128")
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
ActionView::Template::Error: Missing host to link to! Please provide :host parameter …Run Code Online (Sandbox Code Playgroud)