Install ruby from source in Ubuntu7.10

Source: Internet
Author: User
Yesterday I installed Ubuntu7.10 on my machine and set up the ROR platform. As I am a new Linux user, I have made many detours in compiling and installing ruby from source, so I will write it down for future use. Because Ubuntu7.10 does not support csource compilation after gcc is installed by default, to compile ruby from source, you must first install build-essential. Run the following command to install sudoapt-getinstallbuild-e from the source:

Yesterday I installed Ubuntu 7.10 on my machine and set up the ROR platform. As I am a new Linux user, I have made many detours in compiling and installing ruby from source, so I will write it down for future use.

Because the gcc after Ubuntu 7.10 is installed by default cannot compile c source, to compile ruby from source, you must first install build-essential.

Run the following command to install the SDK from the source:
Sudo apt-get install build-essential

Decompress the downloaded ruby source package.
Tar xvf ruby-1.8.6-p110.tar.bz2

Enter the ruby-1.8.6-p110 directory after decompression:
Cd ruby-1.8.6-p110

Configure :( "prefix" --- specifies to install to/opt/ruby, "-- enable-install-doc" specifies to install doc at the same time; otherwise, ri cannot be used in the future)

Sudo./configure -- prefix =/opt/ruby -- enable-install-doc

Make & install:

Sudo make
Sudo make install

Add ruby to the system PATH and write the following code to/etc/profile (and execute it in shell ):
Export PATH = $ PATH:/opt/ruby/bin

Install ruby SSL (if you do not install the later gem I rails, the system will prompt that SSL is missing ):

Switch to the root user: sudo-I

Go to the: cd ruby-1.8.6-p110/ext/openssl just extracted from source

Ruby extconf. rb
Make
Make install

Install rubygems-0.9.5:

Decompress the package and enter the directory for execution.
Ruby steup. rb

Install rails:
Gem I rails

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.