Rails升级到3.2 ActionNotFound奇怪的路由错误

时间:2014-03-20 23:30:51

标签: ruby-on-rails ruby

从Rails 3.1.12升级到3.2.17时,我发生了一个相当奇怪的错误。

基本上,我可以加载一次页面,但是一旦我点击刷新,我就会得到一个

AbstractController::ActionNotFound 

我再次说,你错过了它。我可以加载页面,ONCE。所以我知道路线很好,但是如果我刷新完全相同的页面,我就找不到这个动作了。

这发生在每一页上。我可以查看一次,但在刷新时我无法再查看它。

修复它的方法是,要么反弹rails服务器,要么更改路由文件并保存。

路线文件是大到发布的方式,所以我在这里只使用一个页面作为例子。
该页面位于 / dashboard

路线是:

match '/dashboard', :to => 'pages#dashboard'

我点击了那个页面,它加载得很好,我再次点击它,它失败了

AbstractController::ActionNotFound at /dashboard
The action 'dashboard_pages' could not be found for PagesController

该操作被称为"仪表板"在页面控制器上。

我现在谷歌搜索了一段时间,它的整个" 1视图"令人困惑的事情。我找不到有这个问题的其他人。

任何帮助将不胜感激。

继承堆栈跟踪:

    AbstractController::ActionNotFound - The action 'dashboard_pages' could not be found for PagesController:
      actionpack (3.2.17) lib/abstract_controller/base.rb:116:in `process'
      actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:in `process'
      actionpack (3.2.17) lib/action_controller/metal.rb:203:in `dispatch'
      actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
      actionpack (3.2.17) lib/action_controller/metal.rb:246:in `block in action'
      actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
      actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in `call'
      journey (1.0.4) lib/journey/router.rb:68:in `block in call'
      journey (1.0.4) lib/journey/router.rb:56:in `call'
      actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:in `call'
      meta_request (0.2.8) lib/meta_request/middlewares/app_request_handler.rb:13:in `call'
      rack-contrib (1.1.0) lib/rack/contrib/response_headers.rb:17:in `call'
      meta_request (0.2.8) lib/meta_request/middlewares/headers.rb:16:in `call'
      meta_request (0.2.8) lib/meta_request/middlewares/meta_request_handler.rb:13:in `call'
      newrelic_rpm (3.7.3.204) lib/new_relic/rack/error_collector.rb:55:in `call'
      newrelic_rpm (3.7.3.204) lib/new_relic/rack/agent_hooks.rb:32:in `call'
      newrelic_rpm (3.7.3.204) lib/new_relic/rack/browser_monitoring.rb:27:in `call'
      newrelic_rpm (3.7.3.204) lib/new_relic/rack/developer_mode.rb:45:in `call'
      http_accept_language (2.0.1) lib/http_accept_language/middleware.rb:13:in `call'
      warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
      warden (1.2.3) lib/warden/manager.rb:34:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
      rack (1.4.5) lib/rack/etag.rb:23:in `call'
      rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:in `call'
      rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
      rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:in `call'
      activerecord (3.2.17) lib/active_record/query_cache.rb:64:in `call'
      activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
      activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `_run__3098765915505928900__call__1549657330245414969__callbacks'
      activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
      activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
      activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
      actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/reloader.rb:65:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
      better_errors (1.1.0) lib/better_errors/middleware.rb:84:in `protected_app_call'
      better_errors (1.1.0) lib/better_errors/middleware.rb:79:in `better_errors_call'
      better_errors (1.1.0) lib/better_errors/middleware.rb:56:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
      railties (3.2.17) lib/rails/rack/logger.rb:32:in `call_app'
      railties (3.2.17) lib/rails/rack/logger.rb:16:in `block in call'
      activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:in `tagged'
      railties (3.2.17) lib/rails/rack/logger.rb:16:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:in `call'
      rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
      rack (1.4.5) lib/rack/runtime.rb:17:in `call'
      activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
      rack (1.4.5) lib/rack/lock.rb:15:in `call'
      actionpack (3.2.17) lib/action_dispatch/middleware/static.rb:63:in `call'
       () usr/local/rvm/gems/ruby-1.9.3-p327@secure/bundler/gems/raven-ruby-e6d646402dc7/lib/raven/rack.rb:47:in `call'
      railties (3.2.17) lib/rails/engine.rb:484:in `call'
      railties (3.2.17) lib/rails/application.rb:231:in `call'
      rack (1.4.5) lib/rack/content_length.rb:14:in `call'
      railties (3.2.17) lib/rails/rack/log_tailer.rb:17:in `call'
      rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
      /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
      /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
      /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

1 个答案:

答案 0 :(得分:1)

我发现了问题。

有一段代码正在打印action_name<<视图中的controller_name。在Rails 3.1中,这只是连接字符串并打印出来。在3.2中是改变请求参数。