duy
duy

Reputation: 1920

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.

Everytime this happens it raises an error says "Stack Level Too Deep" then when I refresh the page it agains raise "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.

I tried several methods including increase ulimit "ulimit -s" command, but it didn't solve the problem. 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: 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)

Upvotes: 3

Views: 2689

Answers (2)

G SubbaRao
G SubbaRao

Reputation: 446

Please change your session store to active record store or config.cache_store = :dalli_store (dalli gem), instead of cookie store.

Upvotes: 1

duy
duy

Reputation: 1920

There was a bug in devise_inviable gem that caused the problem I got. I found the answer here helps solve my problem rails 3 routes stack level too deep devise

Upvotes: 0

Related Questions