Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在AWS上部署capistrano期间无法对postgres用户进行身份验证_Ruby On Rails_Postgresql_Amazon Web Services_Capistrano - Fatal编程技术网

Ruby on rails 在AWS上部署capistrano期间无法对postgres用户进行身份验证

Ruby on rails 在AWS上部署capistrano期间无法对postgres用户进行身份验证,ruby-on-rails,postgresql,amazon-web-services,capistrano,Ruby On Rails,Postgresql,Amazon Web Services,Capistrano,我正在尝试将rails应用程序部署到AWS。部署失败 PG::ConnectionBad: FATAL: Ident authentication failed for user "postgres" 我的database.yml文件(由capistrano从我的应用程序根目录下的共享目录合并)如下所示 production: adapter: postgresql encoding: unicode database: tpms_prod username: postgres

我正在尝试将rails应用程序部署到AWS。部署失败

PG::ConnectionBad: FATAL: Ident authentication failed for user "postgres"
我的
database.yml
文件(由capistrano从我的应用程序根目录下的共享目录合并)如下所示

production:
  adapter: postgresql
  encoding: unicode
  database: tpms_prod
  username: postgres
  host: 127.0.0.1
  port: 5432
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
pg_hba.conf
是默认值,如下所示

production:
  adapter: postgresql
  encoding: unicode
  database: tpms_prod
  username: postgres
  host: 127.0.0.1
  port: 5432
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
我已尝试将
pg_hba.conf
中的身份验证设置更改为
password
,但仍报告身份验证失败

我尝试向数据库中添加一个新的超级用户,并在
数据库.yml
文件中使用该用户-但是该用户的身份验证也失败,因此我知道部署进程正在使用
数据库.yml
文件


如果我正确理解ident机制,那么请求连接的用户必须是声明的用户,这在命令行中得到证实

可能是错的。。。。但对我来说,ident意味着数据库(必须创建db用户)和客户端(这里是rails)之间必须有相同的用户名

这意味着如果你想让它工作,你应该以“postgres”用户的身份运行你的rails应用程序(这可能不是最好的主意)