Here’s a quick solution adding a specific user (aka role) in Postgres.
If your rake complains
ActiveRecord::NoDatabaseError (FATAL: role "<appName>" does not exist Run $ bin/rake db:create db:migrate to create your database):
or similar. Try the following.
You may need to setup a user in Postgres for the project.
-s if you get an error about the user not
being able to create databases
createuser <appName> -s.
If you need to delete this user run
And for completeness to drop a database
There’s a very convenient util
pg_ctl init <database name>.
to make a new database.
pg_ctl start -l logfile to start postgres
and move it to the background.