PostgreSQL をインストール
heroku は PostgreSQL なので ubuntu にもインストールする。
$ sudo add-apt-repository ppa:pitti/postgresql $ sudo apt-get update $ sudo apt-get install postgresql libpq-dev
インストール後に postgres というユーザが作られる
このユーザを database.yml に設定する(test, production も同様)
development: host: localhost adapter: postgresql encoding: unicode database: app_name_development pool: 5 username: postgres password:
host がないとうまく接続できなかった。
pgadmin で管理したい場合は postgres にパスワードを設定する。
まずはユーザのパスワード
$ sudo passwd postgres
そして PostgreSQL 内のパスワード
$ su - postgres $ psql template1 $ alter user postgres with password 'password';
psql を抜ける場合は 「\q」 です。
PostgreSQL を再起動
$ sudo /etc/init.d/postgresql restart