ttakeのRuby練習帳

 | 

2007-01-08PostgreSQL 8.2.1 install

参照>PostgreSQL 8.0/8.1のインストール

http://bitarts.jp/tech/linux/postgresql80.html

$ wget ftp://ftp.jp.postgresql.org/source/v8.2.1/postgresql-8.2.1.tar.gz

$ tar xvfz postgresql-8.2.1.tar.gz

$ cd postgresql-8.2.1

$ ./configure

$ make all

$ su

# make install

# /usr/sbin/adduser postgres

# mkdir /usr/local/pgsql/data

# chown postgres:postgres /usr/local/pgsql/data

# su - postgres

[postgres]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

[postgres]$ vi ~postgres/.bash_profile

[postgres]$ source ~postgres/.bash_profile

[postgres]$ pg_ctl start

ここから『はじめようRubyonRails』

[postgres]$ createuser rails

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

CREATE ROLE

[postgres]$ createdb -U rails -E utf8 scheduler_development

CREATE DATABASE

[postgres]$ createdb -U rails -E utf8 scheduler_test

CREATE DATABASE

[postgres]$ createdb -U rails -E utf8 scheduler_production

CREATE DATABASE

アダプタ忘れてた

$ rake db:migrate

rake aborted!

no such file to load -- postgres

(See full trace by running task with --trace)

# gem install postgres-pr

$ /usr/local/pgsql/bin/psql -U rails scheduler_development

トラックバック - http://rubyist.g.hatena.ne.jp/ttake/20070108
 |