Rails Capistrano部署PG :: ConnectionBad:致命:密码验证失败

问题描述 投票:0回答:1
deploy:migrating
      01 /usr/local/rvm/bin/rvm default do bundle exec rake db:migrate
      01 rake aborted!
      01 PG::ConnectionBad: FATAL:  password authentication failed for user "customuser"
...
Tasks: TOP => db:migrate

1)我可以正常登录psql下的customuser 2)命令在serverRAILS_ENV=production rake db:migrate上工作3)database.yml:

production:
  <<: *default
  database: app_production
  host: localhost
  username: customuser
  password: mypassword

4) /etc/PostgreSQL/10/卖弄/苹果_好吧.conf :

# "local" is for Unix domain socket connections only
local   all             all                                     md5

还试过peer

ruby-on-rails postgresql deployment capistrano production-environment
1个回答
0
投票

解决了。需要添加宝石https://github.com/capistrano-plugins/capistrano-postgresql

deploy.rb

set :pg_without_sudo, false
set :pg_host, 'localhost'
set :pg_database, 'appname_production'
set :pg_username, 'username'
set :pg_ask_for_password, true
© www.soinside.com 2019 - 2024. All rights reserved.