Windows 上 Ubuntu 上的 Bash 上的 PostgresQL 帮助

Windows 上 Ubuntu 上的 Bash 上的 PostgresQL 帮助

因此,当我尝试为我的 Rails 应用程序创建数据库时,我得到以下信息:

nmsiriban:~/workspace/code/devcamp/DevCampPortfolio $ rails db:create
could not connect to server: Connection refused
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"DevCampPortfolio_development"}
rails aborted!
PG::ConnectionBad: could not connect to server: Connection refused
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

我在“Windows 上的 Ubuntu 上的 Bash”Bash Shell 和 C9.io 终端 shell 上都不断收到此错误

当我跑步的时候

sudo service postgresql start

它说使用pg_createcluster

当我这样做时我得到了这个:

Nick@NICKS_LAPTOP:~$ sudo pg_createcluster 9.6 main --start
Creating new cluster 9.6/main ...
  config /etc/postgresql/9.6/main
  data   /var/lib/postgresql/9.6/main
  locale en_US.UTF-8
FATAL:  could not create shared memory segment: Function not implemented
DETAIL:  Failed system call was shmget(key=1, size=56, 03600).
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.6/main"
Error: initdb failed

我被困在这一步。我在 Windows 机器上安装了 BigSQL 的 pgAdmin3,并将其安装在 Windows 操作系统的一个文件夹中,并带有指向 Linux 子系统目录的符号链接。

我是 Ubuntu 等基于 Linux 的系统的新用户,并且一直在谷歌上搜索。因此,如果有人需要更多信息,请询问,我会尽力提供您所需的信息。

相关内容