Compile and install ruby1.8.6patchlevel111 in Ubuntujeos7.10

Source: Internet
Author: User
The ruby1.8.6patchlevel produced by apt-getinstall is 36. It seems that if you want to install the latest version in Ubuntujeos7.10, it is easier to have One-ClickRubyInstaller in windows. I installed it from the source and found that many existing tutorials are scattered. The installation process is as follows: 0-install the build tool sudoaptitudeinsta

The patch level of ruby1.8.6 installed by apt-get is 36. It seems that if you want to install the latest version in Ubuntu jeos 7.10, it is better to have One-Click Ruby Installer in windows.

I installed it from the source and found that many of the existing tutorials are scattered.

The installation process is as follows:

0-install the build tool
Sudo aptitude install build-essential linux-headers-$ (uname-r)

1-install readline
Wget ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
Tar xzvf readline-5.2.tar.gz
Cd readline-5.2
./Configure
Make
Sudo make install

2-install ruby
Wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p111.tar.gz
Tar xvfz ruby-1.8.6-p111.tar.gz
Cd ruby-1.8.6-p111
./Configure
Make
Sudo make install
Sudo make install-doc

[Note: After the above installation, ruby will be installed in/usr/local/bin/. This directory is in ubuntu path and can be directly used]
Verify the installation of ruby-v, which is shown:
Ruby 1.8.6 (patchlevel 111) [i686-linux]
In addition, you can run the which ruby command to view the ruby installation location.

3-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

4-install zlib, which is required by gem
First install the zlib1g development kit:
Sudo apt-get install zlib1g-dev

Then download zlibruby
Zlib Homepage
Http://raa.ruby-lang.org/project/ruby-zlib/

Http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
The installation command is as follows:
Wget http://www.blue.sky.or.jp/atelier/ruby/ruby-zlib-0.6.0.tar.gz
Cd ruby-zlib-0.6.0
Ruby extconf. rb
Make
Make install

5. Verify gem installation and upgrade
Sudo gem update -- system
You can also install rails to verify whether the installation is successful.
Sudo gem install rails -- include-dependencies

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.