[英]`load_missing_constant': uninitialized constant Rails::Railtie
[英]`load_missing_constant' after installing Typus rails plugin
收到一個奇怪的錯誤。 剛剛安裝了Typus rails admin插件,該插件應該在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
require'來自腳本/服務器:3
您正在使用restful_authentication嗎?
如果是這樣,restful_authentication提供的“身份驗證”模塊與Typus中包含的模塊之間存在名稱沖突。
我將所有對restful_authentication模塊的引用從Authentication重命名為RestfulAuthentication,並在vendor / plugins / restful_authentication / lib / authentication.rb中更改了模塊名稱。 不知道是否有更好的方法指定模型應使用哪個模塊。
或者,您可以在Restful Authentications前面加上::來清除差異,
::認證而不是認證
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.