ruby-on-rails – PostgreSQL:postgres不知道在哪里可以找到服务器配置文件.

ruby-on-rails – PostgreSQL:postgres不知道在哪里可以找到服务器配置文件.,第1张

概述我正在尝试将postgreSQL配置为我的本地开发数据库. 我跑的时候 brew install postgres 我收到以下错误: postgresql-9.3.5 already installed 在我的Gemfile中,我在gem列表中有pg. 我跑的时候 rake db:create:all 我收到以下错误: could not connect to server: No such fi 我正在尝试将postgresql配置为我的本地开发数据库.

我跑的时候

brew install postgres

我收到以下错误:

postgresql-9.3.5 already installed

在我的Gemfile中,我在gem列表中有pg.

我跑的时候

rake db:create:all

我收到以下错误:

Could not connect to server: No such file or directoryIs the server running locally and acceptingconnections on Unix domain socket "/tmp/.s.PGsql.5432"?

我的database.yml如下所示:

development:  adapter: postgresql  enCoding: unicode  database: fls_development  host: localhost  pool: 5  port: 5432# re-generated from your development database when you run "rake".# Do not set this db to the same as development or production.test:  adapter: postgresql  database: fls_test  pool: 5  timeout: 5000default: &default  adapter: postgresql  enCoding: unicode  pool: 5

此外,类似于这篇文章:How to configure PostgresSQL server on MacOS 10.8.5?,当我只是典型的postgres时,我得到以下错误

postgres does not kNow where to find the server configuration file.You must specify the --config-file or -D invocation option or set the PGDATA environment variable.

我很困惑,因为前面提到的SO帖子的解决方案建议使用Homebrew安装,但我很确定这是我安装它的方式.

解决方法 所以,这是一种间接解决方案,但我只是运行brew uninstall postgresql,然后安装了Postgresql应用程序,该应用程序在正确的端口5432上自动运行. 总结

以上是内存溢出为你收集整理的ruby-on-rails – PostgreSQL:postgres不知道在哪里可以找到服务器配置文件.全部内容,希望文章能够帮你解决ruby-on-rails – PostgreSQL:postgres不知道在哪里可以找到服务器配置文件.所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1276162.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存