Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I did install postgresql according to the manual. But as soon as I do rails server I see the above error.


Edit 1: the sudo -u postgres createuser roelof did the trick but now when I do rake db:create I see this errror message:

PG::InsufficientPrivilege: ERROR: permission denied to create database

share|improve this question

You can create a role with your name by running a createuser command as the postgres system user. Run this in a terminal:

 sudo -u postgres createuser roelof
share|improve this answer
thanks, solved one problem and a new problem does arise. see edit 1 – user1052732 Jul 11 '14 at 17:58
I also found sudo -u postgres createdb roelof useful, so I could simply run psql – Bohemian Feb 12 '15 at 0:06

For PG::InsufficientPrivilege: ERROR: permission denied to create database:

Another way to resolve this problem is going to psql and type \du to list all roles. Make sure your role has the following things:

 Role name |                   Attributes                   | Member of 
 ubuntu    | Superuser, Create role, Create DB, Replication | {}

You might want to use this command psql=# CREATE ROLE roelof SUPERUSER CREATEDB REPLICATION CREATEROLE LOGIN; to resolve this problem.

Next, configure your database.yml:

username: [insert the username]

and if you configured a password, please provide it:

host: localhost
password: #######
port: 5437

Best wishes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.