简体   繁体   English

安装Typus rails插件后的`load_missing_constant'

[英]`load_missing_constant' after installing Typus rails plugin

Getting an odd error. 收到一个奇怪的错误。 Just installed the Typus rails admin plugin, which is supposed to work in 2.3.2. 刚刚安装了Typus rails admin插件,该插件应该在2.3.2中工作。 However, after install it seems to mess with my user model. 但是,安装后似乎与我的用户模型混在一起。 Not sure where to start here, any ideas? 不知道从哪里开始,有什么想法吗?

 => 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 require' from script/server:3 /custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in require'来自脚本/服务器:3

Are you using restful_authentication? 您正在使用restful_authentication吗?

If so, there's a name conflict between the 'Authentication' module restful_authentication provides and the one included in Typus. 如果是这样,restful_authentication提供的“身份验证”模块与Typus中包含的模块之间存在名称冲突。

I renamed all the references to restful_authentication's modules from Authentication to RestfulAuthentication, and changed the module name in vendor/plugins/restful_authentication/lib/authentication.rb. 我将所有对restful_authentication模块的引用从Authentication重命名为RestfulAuthentication,并在vendor / plugins / restful_authentication / lib / authentication.rb中更改了模块名称。 Not sure if there's a better way to specify which module the model should use. 不知道是否有更好的方法指定模型应使用哪个模块。

Alternatively, you can prefix the Restful Authentications with :: to clear up the discrepancy, 或者,您可以在Restful Authentications前面加上::来清除差异,

::Authentication instead of Authentication ::认证而不是认证

暂无
暂无

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

相关问题 `load_missing_constant':未初始化的常量Rails :: Railtie - `load_missing_constant': uninitialized constant Rails::Railtie 尝试在Rails上创建观察者时出现“ load_missing_constant” - 'load_missing_constant' when trying to create an observer on Rails Typus 和 Rails 3.1 - 缺少常量 AdminsController - Typus and Rails 3.1 - missing constant AdminsController `block in load_missing_constant':启动 Rails 服务器和控制台时未初始化的常量 Pry::Command::ExitAll (NameError) - `block in load_missing_constant': uninitialized constant Pry::Command::ExitAll (NameError) when launching rails server and console `load_missing_constant':未初始化的常量AuthenticatedTestHelper(NameError) - `load_missing_constant': uninitialized constant AuthenticatedTestHelper (NameError) radrails开发服务器启动错误:load_missing_constant - radrails dev server startup error: load_missing_constant RSpec load_missing_constant,期望X定义Y(并且确实如此) - RSpec load_missing_constant, expected X to define Y (and it does) 模块`ActiveSupport :: Dependencies'的未定义方法`load_missing_constant' - undefined method `load_missing_constant' for module `ActiveSupport::Dependencies' load_missing_constant' 中的块:未初始化的常量 API::V1::Users (NameError) - block in load_missing_constant': uninitialized constant API::V1::Users (NameError) `load_missing_constant':在自动加载常量 ApplicationRecord (RuntimeError) 时检测到循环依赖 - `load_missing_constant': Circular dependency detected while autoloading constant ApplicationRecord (RuntimeError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM