First install basic software in Ubuntu: aptitudeinstallsubversionlibreadline5-devlibopenssl-rubylibssl-devzlib1g-devbuild-essential-$ (uname-r) imagemagicklibmagick9-devlibmysqlclient15-devxpdfxpdf-chinese-simpli
First install the basic software in Ubuntu:
Aptitude install subversion libreadline5-dev libopenssl-ruby libssl-dev zlib1g-dev build-essential-$ (uname-r) imagemagick libmagick9-dev libmysqlclient15-dev xpdf-chinese-simplified xpdf-chinese-traditional libncurses5-dev gettext memcached sun-java6-jdk
Cd ~
Mkdir lib
Cd ~ /Lib
Download the ruby installation package and put it under lib.
Cd ~ /Lib
Tar zxvf ruby-1.8.6-p111.tar.gz
Mv ruby-1.8.6-p111 ruby-1.8.6-p111-install
Cd ruby-1.8.6-p111-install
./Configure -- prefix = $ HOME/lib/ruby-1.8.6-p111.
Make clean & make
Make install
Cd ~ /Lib
Ln-s ruby-1.8.6-p111 ruby
Modify the. bashrc file and add it to the ruby path:
#! /Bin/bash
Export PATH = $ HOME/lib/ruby/bin: $ PATH
Check whether the ruby command path is correct
Which ruby
Install some extension lib, which is not required, but may be used:
# Zlib:
Cd ~ /Lib/ruby-1.8.6-p111-install/ext/zlib/
Ruby extconf. rb -- with-zlib-include =/usr/include -- with-zlib-lib =/usr/lib
Make clean & make
Make install
# Readline:
Cd ~ /Lib/ruby-1.8.6-p111-install/ext/readline
Ruby extconf. rb
Make clean & make
Make install
# Openssl:
Cd ~ /Lib/ruby-1.8.6-p111-install/ext/openssl
Ruby extconf. rb
Make clean & make
Make install
Download the gc patch for ruby (Omitted) and install:
Cd ~ /Lib/ruby-1.8.6-p111-install
Patch gc. c <ruby185gc. patch
Re-compile ruby:
Cd ~ /Lib/ruby-1.8.6-p111-install
./Configure -- prefix = $ HOME/lib/ruby-1.8.6-p111.
Make clean & make
Make install
Download the gem installation package (Omitted) and unzip the installation package:
Cd ~ /Lib
Tar zxvf rubygems-0.9.5.tgz
Cd rubygems-0.9.5
Ruby./setup. rb
Gem update