my favorite

2010/03/03

RoR on Ubuntu Server 8.04

step 1. install and configure mysql-server

sudo apt-get install mysql-server (config root passwd while installing)
sudo mysql_install_db
# mysqld.sock lives under /var/run/mysql5/
sudo mysqld_safe &
mysql
mysql> create database YOUR_DATABASE;
sudo apt-get install libmysqlclient15-dev
sudo apt-get install build-essential


step 2. download and install ruby

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p248.tar.gz
tar zxf ruby-1.8.7-p248
cd ruby-1.8.7-p248
./configure
make
sudo make install


step 3. download and install rubygems

wget http://rubyforge.org/frs/download.php/69365/rubygems-1.3.6.tgz
tar zxf rubygems-1.3.6.tgz
cd rubygems-1.3.6
ruby setup.rb


step 4. download and install ruby-zlib to solve rubygems zlib failure

wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
tar zxf ruby-zlib-0.6.0.tar.gz
cd ruby-zlib-0.6.0
sudo ruby extconf.rb
make
sudo make install


*note*
prepare for rmagick gem
sudo apt-get install libmagick9-dev ruby1.8-dev



step 5. install required gems

sudo gem install --no-ri --no-rdoc rails
sudo gem install --no-ri --no-rdoc rake
sudo gem install --no-ri --no-rdoc rack
sudo gem install --no-ri --no-rdoc mysql
sudo gem install --no-ri --no-rdoc nifty-generators
sudo gem install --no-ri --no-rdoc passenger
sudo gem install --no-ri --no-rdoc authlogic
sudo gem install --no-ri --no-rdoc paperclip
sudo gem install --no-ri --no-rdoc thinking-sphinx
sudo gem install --no-ri --no-rdoc acts_as_tree
sudo gem install --no-ri --no-rdoc rmagick


step 6. install pcre library for nginx

sudo aptitude install libpcre3 libpcre3-dev


step 7. install and configure passenger for nginx

# prerequisite - openssl library for passenger
sudo apt-get install libssl-dev
cd ~/ruby-1.8.7-p248/ext/openssl
sudo ruby extconf.rb
make
sudo make install
# configure /opt/nginx/conf/nginx.conf
sudo vim /opt/nginx/conf/nginx.conf




NOTICE
in ubuntu, we still need to install openssl library for ruby
sudo apt-get install libopenssl-ruby

[Reference]
gugod : http://gugod.org/2010/01/nginx-on-snow-leopard.html
official : http://www.modrails.com/documentation/Users%20guide%20Nginx.html

No comments:

BIO

Taipei, GuTing, Taiwan

huang47 | personal

huang47 | personal