简体   繁体   中英

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:

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. Any suggestions?

EDIT: Trying to run locally, not for production.

First, I agree not to run production web servers as root. 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. You are also obviously using an authentication method that does not require passwords on the PostgreSQL side. 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).

From there make sure that the username and password are properly specified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM