加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Postgresql的问题`initialize` … Socket .s.P

发布时间:2020-12-17 02:21:18 所属栏目:百科 来源:网络整理
导读:关于这个问题有一些帖子,不幸的是没有一个解决方案对我有用. 我的怀疑是我的postgresql没有运行或没有正确配置. 这是我所在的地方,我有一个我加入的开发项目,他们正在使用postgresql.以下是我要采取的步骤: 克隆回购 更改了config / database.yml.sample的
关于这个问题有一些帖子,不幸的是没有一个解决方案对我有用.

我的怀疑是我的postgresql没有运行或没有正确配置.

这是我所在的地方,我有一个我加入的开发项目,他们正在使用postgresql.以下是我要采取的步骤:

>克隆回购
>更改了config / database.yml.sample的名称 – > database.yml的
>更改了config / s3.yml.sample的名称 – > s3.yml
> Ran捆绑安装
> Ran Rake db:迁移

导致此错误:

rake aborted!
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/pgsql_socket/.s.PGSQL.5432”?

这是我的文件目前的样子:
database.yml的

development:
adapter: postgresql
encoding: unicode
database: rentsnapper_development
pool: 5
username: user
password:

test: &test
adapter: postgresql
encoding: unicode
database: rentsnapper_test
pool: 5
username: user
password:
cucumber:
<<: *test

而我的s3.yml

defaults: &defaults
access_key_id:
secret_access_key:
development:
<<: *defaults
photos_bucket: rentsnapper-photos-development

解决方案:

> https://stackoverflow.com/a/14887090/2066855
没有列出文件
> https://stackoverflow.com/a/14225289/2066855
没有变化,当我运行rake db:migrate时我得到了同样的错误
> https://stackoverflow.com/a/15788389/2066855
没啥事儿

另外作为一个可能有或没有相关性的问题,linux告诉我“ruby-1.9.3-p385未安装”,我正在运行ruby-1.9.3-p362,我怀疑这是无关的.这是我需要更新的东西,还是我可以使用当前版本.

先谢谢你…

解决方法

已解决:我必须修复我的database.yml文件.添加“host:localhost”取出用户&密码行.

development:
adapter: postgresql
encoding: unicode
database: rentsnapper_development
pool: 5
host: localhost

test: &test
adapter: postgresql
encoding: unicode
database: rentsnapper_test
pool: 5
host: localhost

cucumber: <<: *test

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读