Jeff Davis
7/8/2008 2:29:00 PM
On Thu, 2008-06-26 at 17:54 +0900, Michael Pope wrote:
> I've checked that postgres is running on the machine and I can connect
> to it from the command line as user 'user' with no password.
Connecting using:
$ psql winesite_development user
is using a unix local domain socket, whereas:
PGconn.connect("localhost", 5432, '','',"winesite_development","user",
nil)
is using a socket connection to 127.0.0.1.
You can either configure PostgreSQL to accept connections to localhost,
or you can connect using something like:
PGconn.connect("/tmp", 5432, '','',"winesite_development","user", nil)
where "/tmp" is the same as the configuration parameter
"unix_socket_directory" in postgresql.conf.
Or, if you're using the newest "pg" driver (gem install pg), you can do:
PGconn.connect(:dbname=>'winesite_development', :user=>'user')
Regards,
Jeff Davis