From 1124632417be3bb544464aab57fbb6eaa2cc7f39 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 27 Sep 2020 20:03:37 -0700 Subject: [PATCH] fix: explain Postgres error when creating a dev environment (#815) This has tripped me up a few times, so having this in the documentation would save me a Google search. :slightly_smiling_face: --- content/en/dev/setup.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/en/dev/setup.md b/content/en/dev/setup.md index 6986fc6b..4dfa8305 100644 --- a/content/en/dev/setup.md +++ b/content/en/dev/setup.md @@ -19,6 +19,16 @@ In the development environment, Mastodon will use PostgreSQL as the currently si > Please keep in mind, by default Mastodon will run on port 3000. If you configure a different port for it, the generated admin account will use that number. +If `rails db:setup` gives you the Postgres error: + + ActiveRecord::NoDatabaseError: FATAL: role "your_user_name" does not exist + +(where `your_user_name` is your username), then run: + + sudo -u postgres createuser your_user_name --createdb + +This will create the necessary Postgres user with the permission to create a database. + ### Running {#running} There are multiple processes that need to be run for the full set of Mastodon’s functionality, although they can be selectively omitted. To run all of them with just one command, you can install Foreman with `gem install foreman --no-document` and then use: