简体   繁体   English

Rails奇怪的堆栈级别太深和路由错误

[英]Rails strange Stack Level Too Deep & Routing Error

I only get this error in Development Environtment after editing some code (any code) and press Refresh to see the changes. 在编辑一些代码(任何代码)后,我只在Development Environtment中收到此错误,然后按Refresh查看更改。

Everytime this happens it raises an error says " Stack Level Too Deep " then when I refresh the page it agains raise " Routing Error ". 每次发生这种情况时都会引发一个错误,说“ Stack Level Too Deep ”,然后当我刷新页面时,它再次引发“ Routing Error ”。 Then I cannot browse any page until I restart the server. 然后,在重新启动服务器之前,我无法浏览任何页面。

I will have to stop Rails server then start it again, then it works until I make changes to the code again. 我将不得不停止Rails服务器然后再次启动它,然后它工作,直到我再次更改代码。

I tried several methods including increase ulimit "ulimit -s" command, but it didn't solve the problem. 我尝试了几种方法,包括增加ulimit“ulimit -s”命令,但它没有解决问题。 I searched that this is related to infinite loops but in my case it has nothing to do with the code because the error disappears after I restart the server. 我搜索到这与无限循环有关但在我的情况下它与代码无关,因为错误在我重新启动服务器后消失了。

Any clues or solutions would be highly appreciated. 任何线索或解决方案都将受到高度赞赏。 Thanks. 谢谢。

Edited: add routes.rb and stack trace 编辑:添加routes.rb和堆栈跟踪

Routes: http://pastebin.com/YzXyUH35 路线: http//pastebin.com/YzXyUH35

Stack Trace: 堆栈跟踪:

SystemStackError (stack level too deep):
  actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:70


  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms)
  Rendered /Users/duy/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (19.9ms)

请将您的会话存储更改为活动记录存储或config.cache_store = :dalli_storedalli gem),而不是cookie存储。

There was a bug in devise_inviable gem that caused the problem I got. devise_inviable gem中有一个错误导致了我遇到的问题。 I found the answer here helps solve my problem rails 3 routes stack level too deep devise 我发现这里的答案有助于解决我的问题rails 3路由堆栈级别太深的设计

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM