我第一次将应用程序部署到数字海洋,遇到了两个(可能更多)问题。
1)在将gem 'unicorn'添加到Gemfile之后,我无法bundle install。我发现kgio与windows不兼容。当我通过capistrano部署时,我必须让Gemfile.lock出现吗?我该如何解决这个问题呢?
group :production do
gem 'pg', '0.14.1'
gem "nginx"
gem 'unicorn'
end2)在服务器的postgresql上进行身份验证时遇到问题。
production:
adapter: postgresql
encoding: unicode
database: postgresql
pool: 5
username: postgresql
password: secret我运行了以下命令(以及其他一些变体):
create user postgresql with password 'secret';
create database postgresql with owner postgresql;每次我封顶部署时,我都会收到这个错误:
FATAL: Peer authentication failed for user "postgresql"我尝试放入一个我知道不存在的无效用户名,一个无效的数据库,但错误消息总是相同的。根据postgresql网站的说法,我应该会收到不同的错误...
如果我能得到一些帮助那就太棒了。谢谢!
发布于 2014-03-02 09:17:28
您需要指定用于密码身份验证的主机。
production:
adapter: postgresql
encoding: unicode
database: postgresql
pool: 5
host: localhost
username: postgresql
password: secret更多详细信息here
发布于 2013-07-24 05:06:16
您必须首先在pg_hba.conf文件中设置Postgres for password or md5 (safer:scram-sha-256 safer Postgres11) authentication。
只要只允许使用 ,就不会提示密码。仅允许您以系统用户对应的db角色登录。
顺便说一句,数据库角色和操作系统用户通常称为postgresql,而不是。我猜这不是打字错误吧?
在shell中尝试:
sudo -u postgres -i然后以具有对等身份验证的postgres数据库角色登录。
请参见:
https://stackoverflow.com/questions/17819824
复制相似问题