Re: rails with postgresql

Rajinder Yadav
2010-12-07T22:21:49Z

On Tue, Dec 7, 2010 at 4:59 PM, Philip Hallstrom
<philip-LSG90OXdqQE@public.gmane.org> wrote:
>
>
> On Dec 7, 2010, at 1:49 PM, Rajinder Yadav wrote:
>
>> Hi this is my first time for a few things. I am trying to get rails
>> working with postgres-9.0.1, I have never used postgres before. I do
>> know the server is listening on localhost:5432 as I am able to connect
>> to it using pgadmin3 and see the 2 databases on it.
>>
>> I have ''pg'' gem installed
>> my database.yml looks like this
>>
>> development:
>>  adapter: postgresql
>>  encoding: unicode
>>  database: test
>>  pool: 5
>>  username:
>>  password:
>>
>> however i am getting the following migrate error
>>
>> yadav@expression:$ rake db:migrate --trace
>> (in /home/yadav/dev/rails/tmp/testapp)
>> ** Invoke db:migrate (first_time)
>> ** Invoke environment (first_time)
>> ** Execute environment
>> ** Execute db:migrate
>> rake aborted!
>> could not connect to server: No such file or directory
>>        Is the server running locally and accepting
>>        connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.
>> 5432"?
>
> Is the server running locally and accepting connections on that unix domain
socket?  You don''t say that it is...
>
> Or if you don''t want to tweak that, change your database.yml and
add a "host: localhost" entry.
>
> -philip
>
> --

Hi Philip,

that was it, not sure (yet) how to setup the server to listen on the
unix domain socket, but adding the host entry made the connection
possible.

I can now add and view records interactively from the rails console!

Thanks,

--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely

GNU/Linux: 2.6.35-22-generic
Kubuntu x86_64 10.10 | KDE 4.5.1
Ruby 1.9.2p0 | Rails 3.0.1

--
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@googlegroups.com.