# Closed stream error running unit tests through rake

**URL:** <https://www.ruby-forum.com/t/closed-stream-error-running-unit-tests-through-rake/183734>\
**Category:** Rails\
**Created:** [February 19, 2010, 9:20am UTC](https://www.ruby-forum.com/t/closed-stream-error-running-unit-tests-through-rake/183734 "2010-02-19T09:20:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhransu\_behera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@subhransu\_behera](https://www.ruby-forum.com/u/subhransu_behera)\
**Post date:** [February 19, 2010, 9:20am UTC](https://www.ruby-forum.com/t/closed-stream-error-running-unit-tests-through-rake/183734/1 "2010-02-19T09:20:29Z")

</div>

Hi,

I have been trying to run unit tests through rake and getting  
closed stream error. The trace output is mentioned below:

[http://pastie.org/828398](http://pastie.org/828398)

I am on a Mac OSX 10.5.6 (leopard). And having the following  
setting

% Ruby - ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]  
% Rails - 2.3.5  
% mysql gem - (2.8.1, 2.7)  
% MySql Server - 5.1.44 (installed from binary)

I have followed all the database setup steps before trying to run  
the unit tests like:

% rake db:create:all  
% rake db:migrate  
% rake db:test:prepare

I also tried to create an new rails project and tried to execute

% rake test:units

but getting the same error as mentioned in the pastie  
above. Went through couple of posts in different forums also but they  
didn’t help much!

I also tried “rake db:schema:dump” as one of the suggested. But the  
error is till the same.

Any suggestion or hint on this will be great.

Thanks,  
Subh
