検証環境作成 (2)

とりあえず config/database.yml を以下に (一部のみ)。

production:
  adapter: postgresql
  host: localhost
  encoding: utf8
  database: app_db
  pool: 5
  username: railsuser
  password: railsuser

で、postgresql にユーザ作成必要なのか。
以下なのかな。

$ sudo su - postgres -c 'createuser -U postgres -P railsuser'
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
createuser: could not connect to database postgres: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

ぐぬ、動いとらんorz

うぶんつで postgresql なサーバ動かす方法

確認します。何かあれば追記の方向で。

追記

とりあえず、/etc/postgresql/9.1 が無い。今はいってるソレ達を一旦 uninstall して postgresql パケジのみ導入してみます。

$ sudo apt-get remove `dpkg --get-selections|grep postgres|awk '{print $1;}'`

で、postgresql パケジ導入で以下が、とのこと。

これで /etc/postgresql ができるかどうか。

無い

orz
現状導入してる関連パケジは以下なのですが

$ dpkg --get-selections|grep postgres
postgresql                                      install
postgresql-9.1                                  install
postgresql-client-9.1                           install
postgresql-client-common                        install
postgresql-common                               install
postgresql-contrib                              install
postgresql-contrib-9.1                          install

/etc/postgresql ディレクトリは無いですね。/etc/postgresql-common はあります。