I know there are thousands of questsions like this one here on SO but i\'ve seen them all and i\'m still not able to deal with my problem.
I\'m doing everything using an
psql is using a local socket connection, rails is using localhost over TCP/IP. Local is trusted, localhost requires a password (using md5). You could setup a pgpass file for your rails user: http://www.postgresql.org/docs/current/static/libpq-pgpass.html
In C you can do it like this, I don't even know what Rails is
conninfo = "hostaddr = 127.0.0.1 dbname = bitcoin user = alan password = mypass";
conn = PQconnectdb(conninfo);
I had exactly the same error message.