FATAL: role "ricardo" does not exist
Couldn't create 'somedb_development' database. Please check your configuration.
rails aborted!
ActiveRecord::NoDatabaseError: FATAL: role "ricardo" does not exist
bin/rails:4:in `<main>'
Caused by:
PG::ConnectionBad: FATAL: role "ricardo" does not exist
bin/rails:4:in `<main>'
Tasks: TOP => db:create
(See full trace by running task with --trace)
su
su -l postgres
createuser -s -r ricardo
[postgres@ricardo-pc ~]$ initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory /var/lib/postgres/data ... initdb: could not create directory "/var/lib/postgres/data": Permission denied
sudo rm -rf /var/lib/postgres/data
chown -hR postgres /var/lib/postgres
# re-do initdb
# restart postgres daemon
sudo systemctl restart postgresql