Environment: Ubuntu8.041. install build tool sudoaptitudeinstallbuild-essential tiallinux-headers-$ (uname-r) 2. Install readlinezliblibncurses5apt-getinstallzlib1g-devapt-getinstalllibreadline5libreadline5-devapt-ge
Environment: Ubuntu8.04
1. Install the build tool
Sudo aptitude install build-essential linux-headers-$ (uname-r)
2. Install readline zlib libncurses5
Apt-get install zlib1g-dev
Apt-get install libreadline5 libreadline5-dev
Apt-get install libncurses5 libncurses5-dev
3. Install ruby
Download ruby source code:
Http://www.ruby-lang.org/en/downloads/
Wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p114.tar.gz
Tar xvfz ruby-1.8.6-p114.tar.gz
Cd ruby-1.8.6-p114
./Configure -- prefix =/usr/local/ruby
Sudo make
Sudo make install
After installation, add/usr/local/ruby/bin to the path environment variable of the operating system.
Edit/etc/environment
Gedit/etc/environment
Add:
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /usr/local/ruby/bin"
Run the following command to make the environment variable modification take effect:
Source/etc/environment
4. Install gem
Wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz
Tar xzvf rubygems-1.0.1.tgz
Cd rubygems-1.0.1
Sudo ruby setup. rb
Verify that the gem is successfully installed and upgraded
Sudo gem update -- system
5. Install rails
Sudo gem install rails -- include-dependencies
After installing rails, verify whether the installation is successful. Run the following command:
Rails-v
Check the rails version.