Ruby on rails 设计:未定义的方法“params#u authenticable?”和#x27;对于用户:类

Ruby on rails 设计:未定义的方法“params#u authenticable?”和#x27;对于用户:类,ruby-on-rails,ruby,authentication,devise,warden,Ruby On Rails,Ruby,Authentication,Devise,Warden,我正在rails应用程序中使用Desive进行身份验证 我不断收到不同的错误,比如“未定义的User:class方法XXXX”。 寻找一些帮助来正确设置设计 我为用户设置了模块数据库\u可验证设置,我遇到了错误: undefined method `params_authenticatable?' for User:Class 它来自lib/designe/strategies/authenticatable.rb中的以下设计代码 def params_authenticatable?

我正在rails应用程序中使用Desive进行身份验证

我不断收到不同的错误,比如“未定义的User:class方法XXXX”。 寻找一些帮助来正确设置设计

我为用户设置了模块数据库\u可验证设置,我遇到了错误:

undefined method `params_authenticatable?' for User:Class
它来自lib/designe/strategies/authenticatable.rb中的以下设计代码

  def params_authenticatable?
     mapping.to.params_authenticatable?(authenticatable_name) 
  end
以下是我的设计设置:

class User < ActiveRecord::Base
  rolify
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :trackable, :validatable , :omniauthable, :omniauth_providers => [:linkedin]
.
.

end

class DeviseCreateUsers < ActiveRecord::Migration
  def change
    create_table(:users) do |t|
      ## Database authenticatable
      t.string :email,              :null => false, :default => ""
      t.string :encrypted_password, :null => false, :default => ""

      ## Recoverable
      t.string   :reset_password_token
      t.datetime :reset_password_sent_at

      ## Rememberable
      t.datetime :remember_created_at

      ## Trackable
      t.integer  :sign_in_count, :default => 0
      t.datetime :current_sign_in_at
      t.datetime :last_sign_in_at
      t.string   :current_sign_in_ip
      t.string   :last_sign_in_ip

      ## Confirmable
      # t.string   :confirmation_token
      # t.datetime :confirmed_at
      # t.datetime :confirmation_sent_at
      # t.string   :unconfirmed_email # Only if using reconfirmable

      ## Lockable
      # t.integer  :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
      # t.string   :unlock_token # Only if unlock strategy is :email or :both
      # t.datetime :locked_at

      ## Token authenticatable
      # t.string :authentication_token


      t.timestamps
    end

    add_index :users, :email,                :unique => true
    add_index :users, :reset_password_token, :unique => true
    # add_index :users, :confirmation_token,   :unique => true
    # add_index :users, :unlock_token,         :unique => true
    # add_index :users, :authentication_token, :unique => true
  end
end
class用户[:linkedin]
.
.
结束
类designeCreateUsersfalse,:default=>
t、 字符串:加密密码,:null=>false,:default=>
##可恢复
t、 字符串:重置密码\u令牌
t、 日期时间:重置密码发送时间
##难忘的
t、 datetime:记住在
##可追踪
t、 整数:计数中的符号,默认值=>0
t、 日期时间:当前登录时间
t、 日期时间:上次登录时间
t、 字符串:ip中的当前\u符号\u
t、 字符串:ip中的最后\u签名\u
##可证实
#t.string:确认令牌
#t.datetime:已确认
#t.datetime:确认发送至
#t.string:未确认的电子邮件#仅当使用可再确认
##可锁
#t.integer:failed_尝试,:default=>0#仅当锁定策略为:failed_尝试时
#t.string:unlock_token#仅当解锁策略为:email或:两者皆有时
#t.datetime:locked_在
##可认证令牌
#t.string:authentication\u令牌
t、 时间戳
结束
添加索引:users,:email,:unique=>true
添加索引:users,:reset\u password\u token,:unique=>true
#添加索引:users,:confirmation\u token,:unique=>true
#添加索引:users,:unlock\u token,:unique=>true
#添加索引:users,:authentication\u token,:unique=>true
结束
结束
Mu身份验证要求很简单,我想使用Linkedin身份验证,最终也允许其他omni身份验证

我想知道我是否应该使用socery或其他东西进行简单的身份验证

谢谢


我正在使用Rails4.0

完整的错误堆栈跟踪总是很有帮助的。这可能是你在应用程序的另一部分中做过的(或没有做过的)非常琐碎的事情-发布完整的堆栈跟踪会给我们更多的信息:)抱歉,耽搁了。我升级到rails4,在设置postgres和运行迁移方面遇到了一些问题。一旦应用程序正常运行,我将很快发布stacktrace:)