我添加了代码
config.gem "authlogic-oauth", :lib => "authlogic_oauth"
到我的应用程序中的 environment.rb 文件并出现错误
undefined method 'add_acts_as_authentic_module' for ActiveRecord::Base::Class
有什么办法可以解决吗?
我添加了代码
config.gem "authlogic-oauth", :lib => "authlogic_oauth"
到我的应用程序中的 environment.rb 文件并出现错误
undefined method 'add_acts_as_authentic_module' for ActiveRecord::Base::Class
有什么办法可以解决吗?
使用 authlogic-openid 在 rails 3.0.0.beta3 上同样的问题
修复自: http: //futureadapter.com/2009/11/13/authlogic-plugin-errorfix/
此代码应在此文件中(已粘贴我的路径):~/.rvm/gems/ruby-1.9.1-p378/gems/authlogic-oid-1.0.4/lib/authlogic_openid.rb
代码:
if ActiveRecord::Base.respond_to?(:add_acts_as_authentic_module)
ActiveRecord::Base.send(:include, AuthlogicOpenid::ActsAsAuthentic)
Authlogic::Session::Base.send(:include, AuthlogicOpenid::Session)
end
你是否包括了 authlogic 主宝石?
也许这可以帮助你:
http://github.com/tsechingho/authlogic_bundle/issues/unreads#issue/3
我遇到了同样的问题,但是当我删除 Authlogic 的插件版本并通过 environment.rb 包含 gem 时,它得到了解决。
我也遇到了这个错误,但上面并没有为我解决这个问题。在深入挖掘之后,我发现我在 environment.rb 中指定了 v2.1.5 的 authlogic,但服务器上只安装了 2.1.3。rake gems:install 失败并出现同样的错误。一旦我直接安装了 2.1.5 gem,一切就恢复正常了。
在 Rails 3 中,我通过显式依赖 Gemfile 中的任何 authlogic 插件解决了这个authlogic '~>2.1.6'
问题。神奇地走了。