我正在开发一个遗留的 RoR 应用程序,并且正在配置设计(作为 Restful_authentication 插件的替代品)。我遇到了一个非常奇怪的错误。当我尝试转到/users/sign_in
页面时,我得到了这个
NoMethodError in Devise::SessionsController#new
undefined method `is_navigational_format?' for #<Devise::SessionsController:0x000000034b2078>
我唯一一次看到这个错误被引用是当有人试图用他们自己的覆盖设计会话控制器时。(https://groups.google.com/d/msg/plataformatec-devise/jyYNhaRztDU/MLsjwxRvf_YJ)我没有尝试这样做。
我已经正确安装了设计(按照他们的维基)。我已添加devise_for :users
到我的路线。我已经重新启动了服务器,很多次。如果有更多信息或需要的文件,我很乐意提供。
当我$LOAD_PATH.dup
在 rails 控制台中运行时编辑包含的输出
"/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/lib", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/controllers", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/helpers", "/usr/local/rvm/gems/ruby-1.9.3-p429/gems/devise-2.2.4/app/mailers"
我正在使用 Rails 3.2.13、ruby 1.9.3 并设计 2.2.4 这是完整的堆栈跟踪
devise (2.2.4) app/controllers/devise_controller.rb:119:in
require_no_authentication' activesupport (3.2.13) lib/active_support/callbacks.rb:418:in
run _1218703357271506681__process_action_ 3906451143611010656 _callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:405:in__run_callback' activesupport (3.2.13) lib/active_support/callbacks.rb:385:in
_run_process_action_callbacks' active_support (3./2) /callbacks.rb:81:inrun_callbacks' actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in
process_action' actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in
block in process_action' activesupport (3.2.13) lib/active_support/notifications.rb:123:inblock in instrument' activesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in
仪器'activesupport (3.2.13) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in
process_action' actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' actionpack (3.2.13) lib/abstract_controller/base.rb:121:in
process' actionpack (3.2.13) lib/ abstract_controller/rendering.rb:45:inprocess' actionpack (3.2.13) lib/action_controller/metal.rb:203:in
dispatch' actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:indispatch' actionpack (3.2.13) lib/action_controller/metal.rb:246:in
block in action' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:incall' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in
dispatch' actionpack (3.2. 13) lib/action_dispatch/routing/route_set.rb:36:incall' actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:in
call' Journey (1.0.4) lib/journey/router.rb:68:inblock in call' journey (1.0.4) lib/journey/router.rb:56:in
each' Journey (1.0.4) lib/journey/router.rb: 56:incall' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in
call'warden (1.2.1) lib/warden/manager.rb:35:inblock in call' warden (1.2.1) lib/warden/manager.rb:34:in
catch' arden (1.2.1) lib/warden/manager.rb:34:incall' actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in
call' rack (1.4.5) lib /rack/etag.rb:23:incall' rack (1.4.5) lib/rack/conditionalget.rb:25:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242 :incall' rack (1.4.5) lib/rack/session/abstract/id.rb:210:in
context' 机架 (1.4.5) lib/rack/session/abstract/id.rb:205:incall' actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in
call' activerecord (3.2.13) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.13) lib/active_support/callbacks.rb:405:in
run _3871622813520347987_ call _3063468228496691759__callbacks' activesupport (3.2.13 ) lib/active_support/callbacks.rb:405:in__run_callback' activesupport (3.2.13) lib/active_support/callbacks.rb:385:in
_run_call_callbacks' activesupport (3.2.13) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65 :incall' actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall' actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in
call' railties (3.2.13) lib/rails/rack/logger.rb:32:incall_app' railties (3.2.13) lib/rails/rack/logger.rb:16:in
block in call' activesupport ( 3.2.13) lib/active_support/tagged_logging.rb:22:intagged' railties (3.2.13) lib/rails/rack/logger.rb:16:in
call' actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:incall' rack (1.4.5) lib/rack/methodoverride.rb:21:in
call' rack (1.4.5) lib/rack/runtime.rb:17:incall' activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in
call' rack (1.4.5) lib/ rack/lock.rb:15:incall' actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in
call' railties (3.2.13) lib/rails/engine.rb:479:incall' railties (3.2.13) lib/rails/application.rb:223:in
call' railties (3.2.13) lib/rails/railtie/configurable.rb:30:inmethod_missing' passenger (4.0.2) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in
process_request '乘客 (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:135:inaccept_and_process_next_request' passenger (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:106:in
main_loop' 乘客 (4.0.2) lib/phusion_passenger/request_handler.rb:449:inblock (4 levels) in start_threads' passenger (4.0.2) lib/phusion_passenger/utils/robust_interruption.rb:108:in
disable_interruptions' 乘客 (4.0.2) lib/phusion_passenger /request_handler.rb:444:in `start_threads 中的块(3 级)'