Installation guide: https://gorails.com/setup/ubuntu/22.04.
Note: the guide above is only useful up until the part where you need to setup Postgres. We'll use another guide to install and setup Postgres.
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-22-04
https://stackoverflow.com/a/18664239/15065042. Your pg_hba.conf section talked about in the link above should look like:
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
#Additonal notes
if you check your list of roles and you don't see a postgres
as a super user, you need to create one. And also a database named postgres.
=> Setup another role you'd add to your rails app to use username and password. Would save you headache after you've switched to md5 auth.
sudo -i -u postgres
: enter postgres as user terminal
psql
in above: enter interactive repl of sort where you can write raw query and such.
--- In psql repl ---
- \l: list databases
- \du: list users/roles
- \du+: more info with cmd above
- \q: quit psql repl