本文前提是安装好ubuntu server 10.04。
安装ruby1.8.7:
sudo apt-get install ruby build-essential libopenssl-ruby ruby1.8-dev irb rdoc libssl-dev libreadline5-dev zlib1g-dev
安装rubygem1.3.7:
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
安装rails2.3.8:
sudo gem install rails
安装postgresql:
sudo apt-get install postgresql libpq-dev
sudo gem install pg
配置postgresql:
sudo su postgres -c psql template1
ALTER USER postgres WITH PASSWORD '<***postgres***>';
修改postgres pg_hba.conf:
sudo vi /etc/postgresql/8.4/main/pg_hba.conf
local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5 # ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
保存并重新启动postgres服务:
sudo /etc/init.d/postgresql-8.4 restart
本文出自http://www.hansay.com/tags/6