This is a note to myself and those who are interested.GERRG
I use Heroku for hosting my Ruby on Rails applications. Problem is, Heroku doesn’t support SQlite databases.
If you’ve ever tried to run
rails db:migrate to create a postgesSQL database WITHOUT first setting up the databases manually, you will recognize this error:
rails aborted! ActiveRecord::NoDatabaseError: FATAL: database "spitter_development" does not exist
Setup a PostgreSQL database
Run the following command.
If you get this error, your package manager did not setup your user account up properly.
createdb: database creation failed: ERROR: source database "template1" is being accessed by other users
$ createdb $ psql psql (10.10 (Ubuntu 10.10-0ubuntu0.18.04.1)) Type "help" for help.
Create the databases
Once you are in psql, run
\list to see all the databases on your server (service)
Now run the CREATE DATABASE command followed by the name of your rails applications and finally suffixed with
Dont forget the semi-colons! ( ; )
CREATE DATABASE yourapp_development; CREATE DATABASE yourapp_test;
\list command again to confirm your databases were added correctly.