1

我正在开发一个遗留的 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:inrun _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:in run_callbacks' actionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:inprocess_action' actionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:inblock 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:in instrument' actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:inprocess_action' actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in process_action' actionpack (3.2.13) lib/abstract_controller/base.rb:121:inprocess' actionpack (3.2.13) lib/ abstract_controller/rendering.rb:45:inprocess' actionpack (3.2.13) lib/action_controller/metal.rb:203:indispatch' actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.2.13) lib/action_controller/metal.rb:246:inblock in action' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in call' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (3.2. 13) lib/action_dispatch/routing/route_set.rb:36:in call' actionpack (3.2.13) lib/action_dispatch/routing/mapper.rb:42:incall' Journey (1.0.4) lib/journey/router.rb:68:in block in call' journey (1.0.4) lib/journey/router.rb:56:ineach' Journey (1.0.4) lib/journey/router.rb: 56:in call' actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:incall'warden (1.2.1) lib/warden/manager.rb:35:in block in call' warden (1.2.1) lib/warden/manager.rb:34:incatch' arden (1.2.1) lib/warden/manager.rb:34:in call' actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:incall' rack (1.4.5) lib /rack/etag.rb:23:in call' rack (1.4.5) lib/rack/conditionalget.rb:25:incall' actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in call' actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:incall' actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242 :in call' rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext' 机架 (1.4.5) lib/rack/session/abstract/id.rb:205:incall' actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:incall' activerecord (3.2.13) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' activesupport (3.2.13) lib/active_support/callbacks.rb:405:inrun _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:in run_callbacks' actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:65 :in call' actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.13) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.13) lib/rails/rack/logger.rb:16:inblock in call' activesupport ( 3.2.13) lib/active_support/tagged_logging.rb:22:intagged' railties (3.2.13) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.5) lib/rack/methodoverride.rb:21:incall' rack (1.4.5) lib/rack/runtime.rb:17:in call' activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.5) lib/ rack/lock.rb:15:in call' actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:incall' railties (3.2.13) lib/rails/engine.rb:479:in call' railties (3.2.13) lib/rails/application.rb:223:incall' railties (3.2.13) lib/rails/railtie/configurable.rb:30:in method_missing' passenger (4.0.2) lib/phusion_passenger/rack/thread_handler_extension.rb:77:inprocess_request '乘客 (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:135:in accept_and_process_next_request' passenger (4.0.2) lib/phusion_passenger/request_handler/thread_handler.rb:106:inmain_loop' 乘客 (4.0.2) lib/phusion_passenger/request_handler.rb:449:in block (4 levels) in start_threads' passenger (4.0.2) lib/phusion_passenger/utils/robust_interruption.rb:108:indisable_interruptions' 乘客 (4.0.2) lib/phusion_passenger /request_handler.rb:444:in `start_threads 中的块(3 级)'

4

0 回答 0