简体   繁体   English

ActiveAdmin :: Devise :: SessionsController #creore中的ArgumentError

[英]ArgumentError in ActiveAdmin::Devise::SessionsController#create

I installed ActiveAdmin and log in with default admin name and password, while there is an error and hope somebody can help me with it. 我安装了ActiveAdmin并使用默认的管理员名称和密码登录,但有一个错误,希望有人可以帮助我。 Thanks ! 谢谢 !

Here is the error: 这是错误:

ArgumentError in ActiveAdmin::Devise::SessionsController#create 
wrong number of arguments (2 for 1)
Rails.root: E:/Ruby/challenger2 - Copy

Application Trace | Framework Trace | Full Trace
app/helpers/sessions_helper.rb:2:in `sign_in'

Part of the sessions_helper.rb file: sessions_helper.rb文件的一部分:

module SessionsHelper
  def sign_in(user)

    self.current_user = user    
  end

  def current_user=(user)
    @current_user = user
  end

  def current_user
    @current_user ||= user_from_remember_token
  end

  def signed_in?
    !current_user.nil?
  end

end

gem Devise, which Active Admin depends on, probably use "sign_in" function - this name has one of members function of your SessionsHelper module. Active Admin依赖的gem Devise可能使用“sign_in”函数 - 这个名称具有SessionsHelper模块的成员函数之一。 this cause invoke of wrong function. 这导致调用错误的函数。 one solution is not to use activeadmin as an admin tool ))) and the other one is to rename "sign_in" function globally to "sign_in_" for example 一个解决方案不是使用activeadmin作为管理工具)))而另一个解决方案是将“sign_in”函数全局重命名为“sign_in_”,例如

and don't forget to restart server: it helps from time to time ) 并且不要忘记重新启动服务器:它不时帮助)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Devise :: SessionsController#create中的NameError - NameError in Devise::SessionsController#create rails 4:Devise :: SessionsController#create中的NoMethodError - rails 4 : NoMethodError in Devise::SessionsController#create Faraday :: Connection在Devise :: SessionsController#create中失败 - Faraday::ConnectionFailed in Devise::SessionsController#create Rails:Devise中的NameError :: SessionsController#create - Rails: NameError in Devise::SessionsController#create Devise :: SessionsController#create错误中的ActionController :: InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken in Devise::SessionsController#create error RoR - SessionsController中的ArgumentError#创建错误的参数数量(1表示2) - RoR - ArgumentError in SessionsController#create wrong number of arguments (1 for 2) SessionsController#中的Omniauth ArgumentError创建错误数量的参数(1表示2)Rails 4 - Omniauth ArgumentError in SessionsController#create wrong number of arguments (1 for 2) Rails 4 Rails Devise LDAP错误:Devise :: SessionsController#create中的NoMethodError - Rails Devise LDAP Error: NoMethodError in Devise::SessionsController#create 覆盖Devise SessionsController#Create和create视图-身份验证失败 - Overriding Devise SessionsController#Create and create view - and authentication fails SessionsController#create中的NoMethodError - NoMethodError in SessionsController#create
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM