Install rubyonrails in Ubuntu

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.