PostgreSQL error 'Could not connect to server: No such file or directory'

前端 未结 22 1916
梦谈多话
梦谈多话 2020-11-29 17:20

Like some others I am getting this error when I run rake db:migrate in my project or even try most database tasks for my Ruby on Rails 3.2 applications.

22条回答
  •  情歌与酒
    2020-11-29 17:51

    One of the reason could be that

    unix_socket_directories in postgresql.conf file is not listed with the directory it is looking for.

    In the question example it is looking for directory /tmp this has to be provided in the postgresql.conf file

    something like this:

    unix_socket_directories = '/var/run/postgresql,/tmp'    # comma-separated list of directories
    

    This solution worked for me.

提交回复
热议问题