# How to find nil object error in the rails application?

**URL:** <https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217>\
**Category:** Rails\
**Created:** [April 19, 2008, 9:20am UTC](https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217 "2008-04-19T09:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gobi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/76d3ee/32.png) [@gobi](https://www.ruby-forum.com/u/gobi)\
**Post date:** [April 19, 2008, 9:20am UTC](https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217/1 "2008-04-19T09:20:04Z")

</div>

After I added some plugins to rails my application it begin to give  
following error.

Error during failsafe response: You have a nil object when you didn’t  
expect it!  
The error occurred while evaluating nil.symbolize\_keys  
(originally You have a nil object when you didn’t expect it!  
The error occurred while evaluating nil.symbolize\_keys)

But there is no stack trace I dont know why?

When I searched in the code symbolize\_keys is used in lot of places. So  
I dont understand which one is error reason.

Could someone teach me how to investigate such error?

I really have no experience in debugging rails application?

---

<div class="post-metadata">

**Author:** ![gobi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/76d3ee/32.png) [@gobi](https://www.ruby-forum.com/u/gobi)\
**Post date:** [April 19, 2008, 9:47am UTC](https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217/2 "2008-04-19T09:47:08Z")

</div>

rake test # Test all units and functionals  
rake test:functionals  
rake test:integration  
rake test:plugins  
rake test:recent  
rake test:uncommitted  
rake test:units

if you want do trace rake test --trace

reinhart  
[http://teapoci.blogspot.com](http://teapoci.blogspot.com)

---

<div class="post-metadata">

**Author:** ![gobi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/76d3ee/32.png) [@gobi](https://www.ruby-forum.com/u/gobi)\
**Post date:** [April 19, 2008, 9:51am UTC](https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217/3 "2008-04-19T09:51:18Z")

</div>

or you can use it :

[http://snippets.dzone.com/posts/show/697](http://snippets.dzone.com/posts/show/697)

---

<div class="post-metadata">

**Author:** ![gobi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/76d3ee/32.png) [@gobi](https://www.ruby-forum.com/u/gobi)\
**Post date:** [April 19, 2008, 2:54pm UTC](https://www.ruby-forum.com/t/how-to-find-nil-object-error-in-the-rails-application/135217/4 "2008-04-19T14:54:59Z")

</div>

Without a backtrace, all I can think of right now is to remove plugins  
one-by-one until the error goes away. Once you eliminate the error,  
you’ll  
know that the last plugin that you removed was causing the problem. Of  
course, the problem could be caused by the interaction of two or more  
plugins. Thus, once you’ve identified the offending plugin, you may want  
to  
remove all other plugins that you can and try just the offending plugin  
to  
see if it still causes problems.  
Good luck,  
Craig
