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):
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?
nicyoungs...@gmail.com wrote: > 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):
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
> 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
> nicyoungs...@gmail.com wrote: >> 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):
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.
Nic Young wrote: > 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 > <james...@telkomsa.net> wrote:
>> 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?
>>> 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):
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
> 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.
> Nic Young wrote: >> 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 >> <james...@telkomsa.net> wrote:
>>> 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?
>>>> 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):
On Mon, Jun 23, 2008 at 2:07 PM, Nic Young <nicyoungs...@gmail.com> wrote: > 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 > <james...@telkomsa.net> wrote:
>> 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.
>> Nic Young wrote: >>> 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 >>> <james...@telkomsa.net> wrote:
>>>> 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?
>>>>> 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):