I am trying to connect to postgres database from RoR. I have username
and password in database.yml, but when trying to connect, I get the
following error:
No such file or directory - /tmp/.s.PGSQL.5432
Why is it? I would also prefer to connect by TCP connection instead of
UNIX socket, how can I configure this?
I am trying to connect to postgres database from RoR. I have username
and password in database.yml, but when trying to connect, I get the
following error:
No such file or directory - /tmp/.s.PGSQL.5432
Why is it? I would also prefer to connect by TCP connection instead of
UNIX socket, how can I configure this?
I remember having the same problem, but I don’t remember
the details anymore. Anyway, here’s my current database.yml:
I am trying to connect to postgres database from RoR. I have username
and password in database.yml, but when trying to connect, I get the
following error:
No such file or directory - /tmp/.s.PGSQL.5432
Why is it? I would also prefer to connect by TCP connection instead of
UNIX socket, how can I configure this?
Check under ‘connections and authentication’ in data/postgresql.conf to
see if you’re listening on the connect ip-adresses (or listening on ip
at all).
You might also need to adapt data/pg_hba.conf to enable local access
with the account you’re using.
My database.yml looks like the one Stefan L. posted.
Check under ‘connections and authentication’ in data/postgresql.conf to
see if you’re listening on the connect ip-adresses (or listening on ip
at all).
I am. I can connect by phpphadmin (web php tool) with user and password
without problems. But it seems to me that ruby tries to connect by
socket, not by TCP/IP, and I don’t like this.
Ok, it worked, but now I got next error. I have table “Article”, and I
created model Article, but when I try to run test (just to test
connection), I get “Exception: RuntimeError: ERROR C42P01 Mrelation
“article” does not exist Fnamespace.c L221 RRangeVarGetRelid: DELETE
FROM article”
My table has name beginning with capital letter, but I think I doesn’t
matter, because when I had changed it, I still was getting the error.
My table has name beginning with capital letter, but I think I doesn’t
matter, because when I had changed it, I still was getting the error.
I know the parent post is from a long time ago, but it turns out that
this is a bug in the rails postgresql adapter – it doesn’t support
table names with capital letters. There’s a ticket and patch here: