Skip to content

Postgresql instructions

pekman edited this page Mar 26, 2012 · 5 revisions

Run the following commands:

sudo apt-get install postgresql
sudo nano -w /etc/postgresql/9.1/main/pg_hba.conf

Add this line somewhere in the file:

local   all         postgres                          md5

Run the following commands:

sudo service postgresql restart
sudo -u postgres psql postgres

Enter the following command in Postgresql prompt:

\password postgres

Enter postgres as the password and exit to shell with control-D.

Edit config/database.yml and replace the development and test parts with this:

development: &non_production_settings
  adapter: postgresql
  database: aaltoapps_dev
  username: postgres
  password: postgres
  host: localhost
  encoding: UTF8

test:
  <<: *non_production_settings
  database: aaltoapps_test

Save the changes and run the following commands:

rake db:create
rake db:migrate