# Rake tasks aborting with weird postgres issue

**URL:** <https://www.ruby-forum.com/t/rake-tasks-aborting-with-weird-postgres-issue/141193>\
**Category:** Ruby\
**Created:** [June 23, 2008, 1:06pm UTC](https://www.ruby-forum.com/t/rake-tasks-aborting-with-weird-postgres-issue/141193 "2008-06-23T13:06:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nic\_Young](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9e8a1a/32.png) [@Nic\_Young](https://www.ruby-forum.com/u/Nic_Young)\
**Post date:** [June 23, 2008, 1:06pm UTC](https://www.ruby-forum.com/t/rake-tasks-aborting-with-weird-postgres-issue/141193/1 "2008-06-23T13:06:33Z")

</div>

Hey guys, if anyone could help me here I’d really appreciate it.

I’ve recently switched to Rails 2.1, and having a hard time with rake  
tasks and postgres. When I try run anything that involves  
db:test:purge it tell me that the “postgres” database doesn’t exist.  
I’m not trying to connect to the “postgres” database tho. I first hit  
this problem when trying db:test:clone, but the same thing happens  
with rspec rake tasks, if I run the tasks with --trace they all seem  
to cry at db:test:purge. Now from postgres’ perspective, trying to  
connect to “postgres” would happen if I’m trying to connect as the  
postgres user without specifying a db, but I’m not 100% sure that’s  
the problem, and dont know where it’s getting confused even if it is.  
My database.yml file is right, and it’s set up to connect as the db  
user that owns the dev and test databases in question. I’ve even  
tried setting that user as a postgres superuser, but still no luck.

I can connect to the db in script/console… it’s just via rake that  
it has issues.

Here’s a trace (full stack trace not included, I can supply it if  
needed tho):

rake db:test:clone --trace  
(in /home/nic/work/smmt)  
\*\* Invoke db:test:clone (first\_time)  
\*\* Invoke db:schema:dump (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:schema:dump  
\*\* Invoke db:test:purge (first\_time)  
\*\* Invoke environment  
\*\* Execute db:test:purge  
rake aborted!  
FATAL: database “postgres” does not exist

Anybody got any advice?? This is killing me.

Cheers.  
Nic

---

<div class="post-metadata">

**Author:** ![Nic\_Young](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/9e8a1a/32.png) [@Nic\_Young](https://www.ruby-forum.com/u/Nic_Young)\
**Post date:** [June 23, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/rake-tasks-aborting-with-weird-postgres-issue/141193/2 "2008-06-23T13:32:20Z")

</div>

Guys

I need some tutorial on Ruby. It seems to be very  
interesting package. advise what do i do so that i  
become an expert? am already good at MS Access,  
FrontPage, DreamWeaver and a bit of DotNetNuke.
