Google Groups Home
Help | Sign in
rake tasks aborting with weird postgres issue
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
nicyoungster@gmail.com  
View profile
 More options Jun 23, 6:12 am
From: "nicyoungs...@gmail.com" <nicyoungs...@gmail.com>
Date: Mon, 23 Jun 2008 03:12:43 -0700 (PDT)
Local: Mon, Jun 23 2008 6:12 am
Subject: rake tasks aborting with weird postgres issue
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.

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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Silberbauer  
View profile
 More options Jun 23, 6:39 am
From: James Silberbauer <james...@telkomsa.net>
Date: Mon, 23 Jun 2008 12:39:45 +0200
Local: Mon, Jun 23 2008 6:39 am
Subject: Re: [capetown.rb] rake tasks aborting with weird postgres issue
Are you able to connect by running script/console?
Rails 2.1 no longer installs the postgres adaptor - it has to be
installed via gem.
- could this be your problem?

James


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nic Young  
View profile
 More options Jun 23, 6:59 am
From: "Nic Young" <nicyoungs...@gmail.com>
Date: Mon, 23 Jun 2008 12:59:54 +0200
Local: Mon, Jun 23 2008 6:59 am
Subject: Re: [capetown.rb] Re: rake tasks aborting with weird postgres issue
I can connect with script/console yeah.

I've managed to get some stuff done by exporting RAILS_ENV to test and
running rake db:migrate  ...can also run my rspec user stories fine
and can run individual specs with the ruby interpreter... just not via
rake, which is a serious hinderence.

I do have the postgres gem installed, though I didn't know that 2.1 no
longer installed the postgres adapter.  I can see the db from my app,
it's only with rake that I'm having problems.

...still lost.

On Mon, Jun 23, 2008 at 12:39 PM, James Silberbauer


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Silberbauer  
View profile
 More options Jun 23, 7:20 am
From: James Silberbauer <james...@telkomsa.net>
Date: Mon, 23 Jun 2008 13:20:36 +0200
Local: Mon, Jun 23 2008 7:20 am
Subject: Re: [capetown.rb] Re: rake tasks aborting with weird postgres issue
I don't use postgres myself, so I'm just taking a shot in the dark here.

This thread may be related to your problem in some way:
http://www.ruby-forum.com/topic/155617
It seems the drop & create statements have changed in a way that
postgres 8.1 & earlier don't like.

The only other thing I can think of is to check your database.yml for
odd characters.
You shouldn't have tabs, only spaces. Maybe check the "database:" part
of test?
- Try to run script/console -e test and see if you get an error.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nic Young  
View profile
 More options Jun 23, 8:07 am
From: "Nic Young" <nicyoungs...@gmail.com>
Date: Mon, 23 Jun 2008 14:07:12 +0200
Local: Mon, Jun 23 2008 8:07 am
Subject: Re: [capetown.rb] Re: rake tasks aborting with weird postgres issue
Hey James,

Thanks for the direction... Ie monkey patched those methods, but to no
avail... dont think that was the problem, though it did seem
promising.

The first thing I checked was my database.yml, I know how sensitive
yml can be  ...and it's def right.  I also did run script/console test
(you dont need the -e like in script/server) when I checked it the
first time, so the environment is def loading up fine otherwise.  (I
created records from console and they do appear in the test db).  It
really looks like an issue in rake somewhere...  but... ?

...sigh.

On Mon, Jun 23, 2008 at 1:20 PM, James Silberbauer


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nic Young  
View profile
 More options Jun 23, 8:44 am
From: "Nic Young" <nicyoungs...@gmail.com>
Date: Mon, 23 Jun 2008 14:44:46 +0200
Local: Mon, Jun 23 2008 8:44 am
Subject: Re: [capetown.rb] Re: rake tasks aborting with weird postgres issue
So if anyone's interested... don't run Rails 2.1 and postgres
(8.0.15)... just say no.

Rails 2.0.2 works fine.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sheldon Hearn  
View profile
 More options Jun 25, 8:35 am
From: Sheldon Hearn <sheld...@starjuice.net>
Date: Wed, 25 Jun 2008 14:35:41 +0200
Local: Wed, Jun 25 2008 8:35 am
Subject: Re: [capetown.rb] Re: rake tasks aborting with weird postgres issue
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 23 June 2008 14:44:46 Nic Young wrote:

> So if anyone's interested... don't run Rails 2.1 and postgres
> (8.0.15)... just say no.

> Rails 2.0.2 works fine.

My advice is, don't use recent Rails releases that introduced lots of
new features, unless you wish to assist with beta testing.

The Rails core team members are many things -- great release engineers
is not yet an item on the list. :-)

Ciao,
Sheldon.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFIYjudpGJX8XSgas0RAvw6AKCxRO7N2pNZ+dZ/pvLRA/pHkXPtTgCeL6Fy
isBwjlLuYBlui1qTHzu5Rck=
=P/Oi
-----END PGP SIGNATURE-----


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google