# Stack level too deep error : Pulling my hairs out

**URL:** <https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613>\
**Category:** Rails\
**Created:** [March 22, 2006, 1:51pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613 "2006-03-22T13:51:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 22, 2006, 1:51pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613/1 "2006-03-22T13:51:31Z")

</div>

Hello, I’ve changed something in my test application and since I can’t  
find the cause of the “stack level too deep” raising on every request.

I’ve removed almost every part of code and the error still occurs, eg  
with this url : [www.myhost.com/main/index](http://www.myhost.com/main/index)

routes.rb (nothing else in this file)  
map.connect ‘:controller/:action/:id’

app/main\_controller.rb (nothing else in this file)  
class MainController \< ApplicationController  
layout “common”

def index  
end  
end

views/main/index.rhtml (nothing else in this file)  
**I’m here**

This is really frustrating, the development.log file contains thousands  
of  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:72:in  
`const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:189:in `const\_missing’

Below the stack trace there is this note :  
This error occured while loading the following files:  
script/…/config/…/app/controllers/main\_controller.rb

Any help appreciated, this is very frustrating…

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 22, 2006, 2:02pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613/2 "2006-03-22T14:02:12Z")

</div>

I forgot to mention app/controller/application\_controller.rb

class ApplicationController \< ActionController::Base  
end

One mistake on the previous post read  
“app/controller/main\_controller (nothing else in this file)” instead of  
“app/main\_controller.rb (nothing else in this file)”

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 22, 2006, 2:30pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613/3 "2006-03-22T14:30:51Z")

</div>

application\_controller.rb file should be named application.rb

Why ? Dunno… but what the hell !

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [March 22, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/stack-level-too-deep-error-pulling-my-hairs-out/55613/4 "2006-03-22T15:42:29Z")

</div>

at least routes.rb should be

ActionController::Routing::Routes.draw do |map|  
map.connect ‘:controller/:action/:id’  
end
