我想在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) 我使用Rails 3有可能重复的记录在这里.但它没有解决我的问题,也没有解决任何其他问题.
我的迁移如下
class AddConfirmableToDevise < ActiveRecord::Migration
def change
change_table(:users) do |t|
t.confirmable
end
add_index :users, :confirmation_token, :unique => true
end
end
Run Code Online (Sandbox Code Playgroud)
我确实devise :confirmable添加了User模型.
我rake db:migrate没有输出.我的注册页面给出了错误:
undefined local variable or method 'confirmed_at' for #User
Run Code Online (Sandbox Code Playgroud)
有人有线索吗?
我正在使用设计用于Web应用程序,并希望将可确认模块添加到站点.但是,由于未生成确认_token,用户无法登录.点击"未收到确认说明?" 链接令牌仍然没有生成.
确认电子邮件只会生成此链接(请注意网址中缺少令牌):
<p><a href="http://localhost:3000/users/confirmation">Confirm my account</a></p>
Run Code Online (Sandbox Code Playgroud)
让这个工作的最佳方法是什么?
非常感谢,
托尼
authentication ruby-on-rails registration confirmation devise
我是Ruby和Rails的新手,并且与Devise有一些问题.我正在创建一个新的Devise安装.尽管如此,我相信我已经正确配置了devise.rb初始化程序以实现启用confirmable; 但是当我迁移数据库时,confirmed_at并没有相关的字段.我发现了很多关于如何添加它的帖子,但我想知道我是做错了什么还是做错了
rails generate devise User
Run Code Online (Sandbox Code Playgroud)
命令不会生成模型实例,即使您在创建之前已在devise.rb文件中启用了该实例?
我正在学习所以如果我从一开始就错误地配置我的devise.rb文件,我不想手动添加字段.感谢您的任何帮助!!!
附件是我的初始化文件devise.rb
Devise.setup do |config|
config.mailer_sender = ENV["WEBSITE_FROM_ADDRESS"]
require 'devise/orm/active_record'
config.case_insensitive_keys = [ :email ]
config.strip_whitespace_keys = [ :email ]
config.skip_session_storage = [:http_auth]
# ==> Configuration for :database_authenticatable
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
# using other encryptors, it sets how many times you want the password re-encrypted.
#
# Limiting the stretches to just one in …Run Code Online (Sandbox Code Playgroud)