运行 rake db:migrate 时出现以下错误:
undefined method `confirmable' for #<ActiveRecord::ConnectionAdapters::Table:0x6d448e8>
c:/java/RubyProjects/myproject/db/migrate/20111202225103_make_user_confirmable.rb:4:in `block in change'
c:/java/RubyProjects/myproject/db/migrate/20111202225103_make_user_confirmable.rb:3:in `change'
c:in `migrate'
Tasks: TOP => db:migrate
用户.rb:
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :confirmable
...
end
20111202225103_make_user_confirmable.rb:
class MakeUserConfirmable < ActiveRecord::Migration
def change
change_table(:users) do |t|
t.confirmable
end
add_index :users, :confirmation_token, :unique => true
end
end
不知道还要做什么。。
请帮忙。