简体   繁体   English

Postgres连接失败,使用系统用户代替database.yml中提供的用户

[英]Postgres connection fails, uses system user instead the one provided in database.yml

I am trying to run some rspec tests for my Rails app but I get a Postgres connection error. 我正在尝试为我的Rails应用程序运行一些rspec测试,但出现Postgres连接错误。 It uses my system user, instead of the one I provided for the dev environement, in database.yml. 它使用我的系统用户,而不是我在database.yml中为开发环境提供的用户。 Could someone have a look please? 有人可以看看吗? And maybe give me some doc to help me understand how it searches for the user role? 也许给我一些文档来帮助我了解它如何搜索用户角色?

An error occurred while loading ./spec/helpers/navigation_helper_spec.rb.
Failure/Error: ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::NoDatabaseError:
FATAL:  role "yopeso_internship" does not exist
# ./spec/rails_helper.rb:28:in `<top (required)>'
# ./spec/helpers/navigation_helper_spec.rb:1:in `<top (required)>'

# --- Caused by: ---
# PG::ConnectionBad:
#   FATAL:  role "yopeso_internship" does not exist
#   ./spec/rails_helper.rb:28:in `<top (required)>'

In your database.yml you are not providing valid credentials for your test environment like you did for development . database.yml您没有像development一样为test environment提供有效的凭据。

Also show your database.yml . 同时显示您的database.yml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在rake任务中使用database.yml而不是提供用户/密码 - Using database.yml in rake tasks instead of providing user/pass database.yml 文件中的 Postgres 数据库用户名 - Postgres database username in database.yml file 自动在Postgres的database.yml中设置用户名 - Automatically set username in database.yml for Postgres Dokku postgres服务名称和database.yml - Dokku postgres service name and database.yml Postgres &lt;=&gt; Rails。 如何从database.yml自动创建用户 - Postgres <=> Rails . How to auto-create a user from database.yml 部署时.gitignore中的/config/database.yml找不到/config/database.yml,应该改用/shared/database.yml,怎么办? - /config/database.yml in .gitignore on deploy /config/database.yml not found should use /shared/database.yml instead, how? 如何设置database.yml连接到Postgres Docker容器? - How to setup database.yml to connect to Postgres Docker container? Rails:单元测试失败,并显示“没有这样的文件或目录…database.yml”错误 - Rails: unit test fails with “No such file or directory…database.yml” error 在Ruby on Rails中将连接字符串转换为database.yml文件 - Translating a connection string to database.yml file in Ruby on Rails rails + database.yml中的最大连接池大小 - rails + maximum connection pool size in database.yml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM