安装Typus rails插件后`load_missing_constant'

时间:2009-07-17 21:06:46

标签: ruby-on-rails

得到一个奇怪的错误。刚刚安装了Typus rails管理插件,它应该在2.3.2中运行。但是,安装后似乎弄乱了我的用户模型。不知道从哪里开始,任何想法?

 => Booting Mongrel
    => Rails 2.3.2 application starting on http://0.0.0.0:3000
    /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Typus::Authentication::ByPassword (NameError)
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
        from /Users/apple/Sites/app/app/models/user.rb:10
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:380:in `load_file'
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:379:in `load_file'
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:259:in `require_or_load'
        from /Users/apple/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:425:in `load_missing_constant'
         ... 35 levels...
        from /Users/apple/.gem/ruby/1.8/gems/rails-2.3.2/lib/commands/server.rb:84
        from /Library/Ruby/Site/1.8/rubygems

/custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in要求'         来自脚本/服务器:3

2 个答案:

答案 0 :(得分:1)

您使用的是restful_authentication吗?

如果是这样,restful_authentication提供的'Authentication'模块与Typus中包含的模块之间存在名称冲突。

我将restful_authentication模块的所有引用重命名为Authentication to RestfulAuthentication,并更改了vendor / plugins / restful_authentication / lib / authentication.rb中的模块名称。不确定是否有更好的方法来指定模型应该使用哪个模块。

答案 1 :(得分:0)

或者,您可以在Restful Authentications前加上::以清除差异,

::身份验证而非身份验证