So I'm working on a ruby on rails project with a team, and they use ubuntu through vagrant to host the database (in postgresql), so all the rails commands are still executed from the host machine (windows).
Basically, I'm having troubles connecting the two ends, everytime I try to go on any page, it tells me
PG::ConnectionBad
could not connect to server: Cannot assign requested address (0x00002741/10049) Is the server running on host "0.0.0.0" and accepting TCP/IP connections on port 6543?
The Vagrantfile forwards the port 6543 to 5432
config.vm.network :forwarded_port, guest: 5432, host: 6543
and when I ssh into vagrant, it does indeed seem to be listening on that port:
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN
I don't know what's not working, I've even tried disabling the firewall to check whether that was the issue, but it wasn't.
I welcome any help that can be offered. Thank you
EDIT: After reading this, I looked at my pg_hba.conf file, but it looks like it's allowing all connections:
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/0 trust
# IPv6 local connections:
host all all ::/0 trust