[英]Get webrick server to run on port 80 with postgres
I'm getting a postgres error when I try to run webrick on port 80 like so: 当我尝试在端口80上运行webrick时,出现了Postgres错误:
rvmsudo rails s -p 80
I then get this error: 然后我得到这个错误:
Users/user/.rvm/gems/ruby-1.9.3-p194@app/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': FATAL: role "root" does not exist (PG::Error)
Plus much more to the stack trace. 再加上更多的堆栈跟踪。
I tried changing my user to root
in database.yml, but no luck. 我试图将我的用户更改为
root
用户进入database.yml,但是没有运气。 Any suggestions? 有什么建议么?
EDIT: Trying to run locally, not for production. 编辑:尝试在本地运行,而不是用于生产。
First, I agree not to run production web servers as root. 首先,我同意不以root身份运行生产Web服务器。 That's just a bad idea.
那真是个坏主意。
As for what is going on here, you are not supplying PostgreSQL login credentials and so it is sending the process owner's name, and no password. 至于这里发生的事情,您没有提供PostgreSQL登录凭据,因此它发送的是进程所有者的名称,没有密码。 You are also obviously using an authentication method that does not require passwords on the PostgreSQL side.
显然,您也在使用不需要PostgreSQL端密码的身份验证方法。 I would suggest connecting over tcp/ip (specifying localhost as the host), and making sure that the auth type in the
pg_hba.conf
is set to md5
(but if you can't do this cert auth may be ok with a client cert). 我建议通过tcp / ip(将localhost指定为主机)进行连接,并确保
pg_hba.conf
中的身份验证类型设置为md5
(但是如果您不能执行此证书,则可以使用客户端证书进行身份验证)。
From there make sure that the username and password are properly specified. 从那里确保正确指定了用户名和密码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.