# "rake test" works but "rake test:units" fails

**URL:** <https://www.ruby-forum.com/t/rake-test-works-but-rake-test-units-fails/157818>\
**Category:** Rails\
**Created:** [January 15, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/rake-test-works-but-rake-test-units-fails/157818 "2009-01-15T17:01:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsmagazine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b5a626/32.png) [@railsmagazine](https://www.ruby-forum.com/u/railsmagazine)\
**Post date:** [January 15, 2009, 5:01pm UTC](https://www.ruby-forum.com/t/rake-test-works-but-rake-test-units-fails/157818/1 "2009-01-15T17:01:18Z")

</div>

“rake test” runs all the tests as it should…

but “rake test:units”  
C:…\>rake test:units  
(in C:/…/…)  
rake aborted!  
FATAL C3D000 Mdatabase “postgres” does not exist Fpostinit.c  
L274  
RInitPostgres

(See full trace by running task with --trace)

Small part of the trace:  
C:…\>rake test:units --trace  
(in C:/…/…)  
\*\* Invoke test:units (first\_time)  
\*\* Invoke db:test:prepare (first\_time)  
\*\* Invoke db:abort\_if\_pending\_migrations (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:abort\_if\_pending\_migrations  
\*\* Execute db:test:prepare  
\*\* Invoke db:test:load (first\_time)  
\*\* Invoke db:test:purge (first\_time)  
\*\* Invoke environment  
\*\* Execute db:test:purge  
rake aborted!  
FATAL C3D000 Mdatabase “postgres” does not exist Fpostinit.c  
L274 RInitPostgres  
C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.5.0/lib/postgres-pr/connection.rb:81:in  
`initialize' C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.5.0/lib/postgres-pr/connection.rb:55:in`loop’  
C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.5.0/lib/postgres-pr/connection.rb:55:in  
`initialize' C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.5.0/lib/postgres-pr/postgres-compat.rb:23:in`new’  
C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.5.0/lib/postgres-pr/postgres-compat.rb:23:in  
`initialize’

Note that test:functionals, and test:integration produce the same  
result.  
test, development, production databases all work fine. Is there a way  
that test:units is somehow using different configuration settings? Where  
do I look?

I’m using rails 2.2.2

Thanks
