# Problem running rake test

**URL:** <https://www.ruby-forum.com/t/problem-running-rake-test/158199>\
**Category:** Rails\
**Created:** [January 20, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199 "2009-01-20T12:54:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![safestate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/87869e/32.png) [@safestate](https://www.ruby-forum.com/u/safestate)\
**Post date:** [January 20, 2009, 12:54pm UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199/1 "2009-01-20T12:54:23Z")

</div>

I’m using the One-click 1.8.7rc2 Ruby Windows installer, everything  
has been working fine up till now, when i want to start getting into  
testing, i got this error, any reason why?

C:/Ruby/bin/ruby -Ilib;test “C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/  
lib/rake/rake\_test\_loader.rb” “test/unit/word\_test.rb”  
C:/Ruby/lib/ruby/1.8/erb.rb:469:in `scan': You have a nil object when you didn't expect it! (NoMethodError) You might have expected an instance of Array. The error occurred while evaluating nil.empty? from C:/Ruby/lib/ruby/1.8/erb.rb:525:in`compile’  
from C:/Ruby/lib/ruby/1.8/erb.rb:692:in `initialize' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/template_handlers/erb.rb:51:in`new’  
from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/  
action\_view/template\_handlers/erb.rb:51:in `compile' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/template_handler.rb:11:in`call’  
from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/  
action\_view/renderable.rb:21:in `_unmemoized_compiled_source' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/memoizable.rb:57:in`compiled\_source’  
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/  
active\_support/memoizable.rb:25:in ` __send__' ... 24 levels... from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/ rake_test_loader.rb:5:in`load’  
from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/  
rake\_test\_loader.rb:5  
from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/  
rake\_test\_loader.rb:5:in `each' from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/ rake_test_loader.rb:5 C:/Ruby/bin/ruby -Ilib;test "C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/ lib/rake/rake_test_loader.rb" "test/functional/admin/words_controller _test.rb" "test/functional/words_controller_test.rb" C:/Ruby/lib/ruby/1.8/erb.rb:469:in`scan’: You have a nil object when  
you didn’t expect it! (NoMethodError)  
You might have expected an instance of Array.  
The error occurred while evaluating nil.empty?  
from C:/Ruby/lib/ruby/1.8/erb.rb:525:in `compile' from C:/Ruby/lib/ruby/1.8/erb.rb:692:in`initialize’  
from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/  
action\_view/template\_handlers/erb.rb:51:in `new' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/template_handlers/erb.rb:51:in`compile’  
from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/  
action\_view/template\_handler.rb:11:in `call' from C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/ action_view/renderable.rb:21:in`\_unmemoized\_compiled\_source’  
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/  
active\_support/memoizable.rb:57:in `compiled_source' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ active_support/memoizable.rb:25:in` **send** ’  
… 24 levels…  
from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/  
rake\_test\_loader.rb:5:in `load' from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/ rake_test_loader.rb:5 from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/ rake_test_loader.rb:5:in`each’  
from C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/  
rake\_test\_loader.rb:5  
C:/Ruby/bin/ruby -Ilib;test “C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/  
lib/rake/rake\_test\_loader.rb”  
Errors running test:units and test:functionals!

---

<div class="post-metadata">

**Author:** ![safestate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/87869e/32.png) [@safestate](https://www.ruby-forum.com/u/safestate)\
**Post date:** [January 22, 2009, 11:26am UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199/2 "2009-01-22T11:26:56Z")

</div>

Can someone tell me how to solve this?

---

<div class="post-metadata">

**Author:** ![safestate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/87869e/32.png) [@safestate](https://www.ruby-forum.com/u/safestate)\
**Post date:** [January 22, 2009, 3:55pm UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199/3 "2009-01-22T15:55:40Z")

</div>

safestate wrote:

> Can someone tell me how to solve this?

The first tip is scan thru all that barf for the first line in code you  
wrote,  
not library code. (Not that library code is bug-free, but you just have  
better  
odds to understand it!)

> > ```
> > ... 24 levels...
> > 
> > ```

However, you must run that test again, maybe with ruby  
test/unit/whatever.rb, so  
the pin-head system won’t elide the filenames from your own code!

---

<div class="post-metadata">

**Author:** ![safestate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/87869e/32.png) [@safestate](https://www.ruby-forum.com/u/safestate)\
**Post date:** [January 23, 2009, 11:49am UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199/4 "2009-01-23T11:49:54Z")

</div>

Thanks for that, i don’t recall using any jpgs, but its definitely  
worth a try. will post back soon with results.

---

<div class="post-metadata">

**Author:** ![safestate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/87869e/32.png) [@safestate](https://www.ruby-forum.com/u/safestate)\
**Post date:** [January 23, 2009, 12:48am UTC](https://www.ruby-forum.com/t/problem-running-rake-test/158199/5 "2009-01-23T00:48:01Z")

</div>

I had the same error running my tests. It was working fine then  
stopped working with the above error. Unfortunately, the trace is not  
real helpful because the error was occurring in environment.rb …  
template\_handlers.rb … erb.rb. Rather than debug Rails or Ruby I  
went through a process of elimination to find what file was causing  
the issue.

I found a .jpg file in one of my view folders that if removed allowed  
the test to complete properly. Per where the error occurring in  
template\_handlers, while I don’t know why it puked on this file, it  
did relate to a view folder.

I don’t recall any documentation restricting .jpg files from view  
folders but maybe I missed something.

I hope this helps.
