I'm trying to run a previously working Rails 3 app with this configuration:
development:
adapter: postgres-pr
#encoding: utf-8
host: localhost
port: 5432
database: name
username: user-name
password: user-password
#pool: 5
#timeout: 5000
#reconnect: true
It's the first time I use Postgres, so my configuration may be off. PGAdmin works, though.
pg_hba.conf has the following:
local all postgres peer
local all user-name password
host all user-name 127.0.0.1/32 password
host all user-name ::1/128 password
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
(I tried other configurations, it doesn't seem to change things).
I get the error ActiveRecord::ConnectionNotEstablished
whenever I try to load any page. The network trace reveals the following:
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 9
setsockopt(9, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(9, {sa_family=AF_INET, sin_port=htons(3000), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(9, 100) = 0
accept(9, {sa_family=AF_INET, sin_port=htons(50500), sin_addr=inet_addr("127.0.0.1")}, [16]) = 10
setsockopt(10, SOL_TCP, TCP_NODELAY, [1], 4) = 0
accept(9, 0xbf937aec, [16]) = -1 EAGAIN (Resource temporarily unavailable)
getpeername(10, {sa_family=AF_INET, sin_port=htons(50500), sin_addr=inet_addr("127.0.0.1")}, [16]) = 0
network,open
trace doesn't have the port 5432 either.
I can't see the port that I wanted here, am I setting it in the wrong way? What else could be the problem here?