I\'m working on an application in Rails for my college. The application was started by the students from previous year and now it\'s me and my colleagues turn to continue wo
Try to use:
sudo -u postgres createuser --interactive --pwprompt
to add the role and the password
You have to create corresponding user and database manually like this:
in shell:
psql
then:
create user alphauser with password 'alphapassword';
create database alpha_database owner alphauser;
alter user alphauser superuser createrole createdb replication;
\q
don't forget semicolons.
create user alphauser with password 'alphapassword';
Then
rake db:setup
So the problem is with your rails application using the database.yml
file to try and connect to your local database and failing to find the user alphauser
(since I assume you're using different computers/environments as the previous students).
Databases have users similar to applications, the postgres documentation is pretty dense on this, but I would guess if you can create a user alphauser
, and make it's password alphapassword
then you will have a new clean database for your app that you can run rake db:migrate
on.
Postgres docs: http://www.postgresql.org/docs/9.2/static/app-createuser.html
Try running this command from the command line createuser -P -s -e alphauser
This will prompt for a password, which is alphauserpassword