Hello All, I''m relatively new to Ruby and Rails. I''m working with PostgreSQL successfully as a development database server, and I want to use it in production and testing as well. My development server is called (myapp)_dev. My test database server is called (myapp)_test. Both exist on the same machine and both were created using the createdb PostgreSQL function. I can''t connect to the test database using rake db:test:prepare. The message that shows up in my pgsql logfile is "FATAL: database (myapp)_test does not exist". Yet if I try to create a database with that name using the createdb function, this shows up in my log: "ERROR: (myapp)_test already exists". I''m sure it''s something simple that I''m doing wrong, but I can''t figure out what. Any help is appreciated. Using Ruby 1.8.7, Rails 2.3.5, PostgreSQL 8.4.2 and Mac OS X Snow Leopard. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Feb-05 20:01 UTC
Re: PostgreSQL Test Database DNE for rake, does exist for ps
Steve H. wrote:> Hello All, > > I''m relatively new to Ruby and Rails. I''m working with PostgreSQL > successfully as a development database server, and I want to use it in > production and testing as well. My development server is called > (myapp)_dev. My test database server is called (myapp)_test. Both exist > on the same machine and both were created using the createdb PostgreSQL > function. > > I can''t connect to the test database using rake db:test:prepare. The > message that shows up in my pgsql logfile is "FATAL: database > (myapp)_test does not exist". Yet if I try to create a database with > that name using the createdb function, this shows up in my log: "ERROR: > (myapp)_test already exists". > > I''m sure it''s something simple that I''m doing wrong, but I can''t figure > out what. Any help is appreciated. >Permissions issue, perhaps? And does script/dbconsole work for your test database?> Using Ruby 1.8.7, Rails 2.3.5, PostgreSQL 8.4.2 and Mac OS X Snow > Leopard.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Steve H.
2010-Feb-05 20:53 UTC
Re: PostgreSQL Test Database DNE for rake, does exist for ps
>Marnen Laibow-Koser wrote: > > Permissions issue, perhaps? And does script/dbconsole work for your > test database? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgThanks for the response. Running ''script/dbconsole test'' does put me in psql for my test database. I''m (OS X username) set as the owner for both my dev and test environment. I thought possibly I just needed a restart of the server, but that was also to no avail. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Feb-05 22:14 UTC
Re: PostgreSQL Test Database DNE for rake, does exist for ps
Steve H. wrote:>>Marnen Laibow-Koser wrote: >> >> Permissions issue, perhaps? And does script/dbconsole work for your >> test database? >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Thanks for the response. > > Running ''script/dbconsole test'' does put me in psql for my test > database.OK.> I''m (OS X username) set as the owner for both my dev and test > environment.That''s irrelevant. What is relevant is which Postgres user account Rails is using to connect to the DB. Does that account have the appropriate permissions?> > I thought possibly I just needed a restart of the server, but that was > also to no avail.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Steve H.
2010-Feb-05 22:24 UTC
Re: PostgreSQL Test Database DNE for rake, does exist for ps
> That''s irrelevant. What is relevant is which Postgres user account > Rails is using to connect to the DB. Does that account have the > appropriate permissions? >Postgres user account is the same name as my machine user account, that''s why I mentioned it. Same postgres user has created and owns both databases, and is a superuser. I''ve since tried making another database and another postgres user, but I''m still getting the message "FATAL: database "(myapp)_test" does not exist" -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Steve H.
2010-Feb-07 00:41 UTC
Re: PostgreSQL Test Database DNE for rake, does exist for ps
I guess I''ve just been paying far too much attention to the log file of Postgres. I think every time a test is launched, the database is dropped and then created. It seems to log a "database does not exist" message every time. I paid a bunch of attention to this because of built-in tests failing. Thanks to Marnen for his efforts and patience. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.