Discourse 开发环境安装 PGSQL 提示错误

在 Discourse 开放环境安装的时候提示错误:

root@YuCheng-Hu:/mnt/d/WorkDir/Repository/Discource-C/discourse# sudo -u postgres createuser -s "$USER"
createuser: error: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

问题和解决

出现上面的问题的原因是你的的 PGSQL 数据库还没有启动。

运行下面的命令启动 PGSQL 数据库。

sudo service postgresql start

这样,如果你再运行上面的命令就没有错误了。