`
love~ruby+rails
  • 浏览: 849520 次
  • 性别: Icon_minigender_1
  • 来自: lanzhou
社区版块
存档分类
最新评论

Installing Ruby 1.8 and 1.9 on Ubuntu from Source

阅读更多

$ sudo apt-get build-dep ruby1.8 ruby1.9

Create a directory for the Ruby source code.

$ mkdir /home/ryan/source
$ cd /home/ryan/source

Check out the code from the 1.8 branch. Since this branch includes patches, you can always update your source and recompile when new patches are released.

$ svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8 ruby1.8

Next, create a configuration, configure, and compile.

$ cd ruby1.8
$ autoconf
$ ./configure --prefix=/opt/ruby1.8 --program-suffix=1.8
$ sudo make
$ sudo make install

Finally, link your new binaries to the /usr/local/bin directory.

$ sudo ln -s /opt/ruby1.8/bin/* /usr/local/bin

Typing ruby1.8 -v in a new console should yield something similar to the following:

$ ruby1.8 -v
ruby 1.8.7 (2008-09-15 revision 19348) [i686-linux]

One of the best parts of Ruby is Rubygems! Download and install it.

$ wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
$ tar -xvzf rubygems-1.2.0.tgz
$ cd rubygems-1.2.0
$ sudo ruby1.8 setup.rb

The current source for Ruby 1.9 requires version 1.8 to compile, but if you’ve followed my directions up to this point you should be ready to download and compile the latest Ruby 1.9 source code.

Go back to your source directory and check out the latest code from the 1.9 trunk.

$ cd /home/ryan/source
$ svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby1.9
$ cd ruby1.9

This time use the –with-baseruby switch when configuring. Set this option to the new Ruby 1.8 binary and then compile.

$ autoconf
$ ./configure --with-baseruby=/usr/local/bin/ruby1.8 --prefix=/opt/ruby1.9 --program-suffix=1.9
$ sudo make
$ sudo make install

Finish by linking your new Ruby 1.9 binaries to /usr/local/bin.

$ sudo ln -s /opt/ruby1.9/bin/* /usr/local/bin

Typing ruby1.9 -v in your console should yield something similar to the following:

$ ruby1.9 -v
ruby 1.9.0 (2008-09-15 revision 19351) [i686-linux]

Ruby 1.9 includes Rubygems! We’re done!

分享到:
评论

相关推荐

    Beginning.Ruby.From.Novice.to.Professional.3rd.Edition.1484212797

    Based on the bestselling first and second editions, Beginning Ruby, Third Edition is a leading guide to learn Ruby from the ground up. The new edition of this book provides the same excellent ...

    Installing STLinux on Ubuntu

    ### 安装STLinux在Ubuntu上的关键步骤与挑战 #### 概览 本文将深入探讨在Ubuntu上安装STLinux的全过程,重点解析由于包管理系统的差异而带来的挑战及其解决方案。对于那些希望在Ubuntu环境中利用STLinux强大功能的...

    Beginning Ruby on Rails

    Ruby on Rails is the revolutionary online programming tool that makes creating functional e-commerce web sites faster and easier than ever. With the intuitive, straightforward nature of Ruby and the ...

    installing samba on ubuntu

    面是我在Ubuntu6.06 LTS 下源码编译安装samba主要安装过程,本人第一次用Ubuntu,刚装上去时候,没有gcc编译环境。郁闷了半天。找出这一过程发了不少的时间。可能还有些不妥,不过我经过这样的安装达到了向windows共享...

    MySQL V5.5帮助文档

    2.2. Installing MySQL from Generic Binaries on Unix/Linux 2.3. Installing MySQL on Microsoft Windows 2.3.1. MySQL Installation Layout on Microsoft Windows 2.3.2. Choosing An Installation Package 2.3.3...

    anaconda安装 - Installing Anaconda on Ubuntu

    ### 安装Anaconda在Ubuntu上的详细步骤及关键知识点 #### 一、Anaconda简介 Anaconda是一款非常受欢迎的数据科学平台,它集成了Python或R语言环境中的许多库和工具,便于用户进行数据处理、科学计算、机器学习等...

    Ubuntu.15.04.Server.with.systemd.Administration.and.Reference.epub

    This book is designed as an Ubuntu 15.04 server reference, covering the Ubuntu servers and their support applications. Server tools are covered as well as the underlying configuration files and system...

    Ubuntu 使用手册 14.04 最新版本(英文原版)

    Installing Ubuntu—Getting started 11 Finishing Installation 16 2 The Ubuntu Desktop 19 Understanding the Ubuntu desktop 19 Unity 19 The Launcher 21 The Dash 21 Workspaces 24 Managing windows 24 Unity...

    ruby安装升级及命令自行编译安装非APTGET方式安装升级的办法

    Ubuntu用户通常会依赖于包管理工具`apt-get`来安装Ruby,这种方式虽然简单便捷,但在某些情况下可能无法满足定制化的需求。本文将详细介绍如何通过手动编译的方式安装Ruby,并提供一种灵活的升级策略。 #### 手动...

    Ubuntu Server Guide < 英文版>

    The Ubuntu Server Guide contains information on how to install and configure various server applications on your Ubuntu system to fit your needs. It is a step-by-step, task-oriented guide for ...

    OpenERP Installing Ubuntu9.04

    OpenERP Installing Ubuntu9.04

    Ubuntu Pocket Guide and Reference: A concise companion for day-to-day Ubuntu use

    - **Installation**: The book starts with a detailed guide on installing Ubuntu on your computer, covering various scenarios and hardware configurations. - **Hardware Configuration**: After ...

    Exam Ref 70-410: Installing and Configuring Windows Server 2012 R2

    Designed for experienced IT professionals ready to advance their status, Exam Ref focuses on the critical thinking and decision making acumen needed for success at the MCSA level. Focus on the ...

    Beginning.Ubuntu.LTS.Server.Administration.From.Novice.to.Professional.2nd.Edition

    Installing and configuring Ubuntu to ensure secure installations Virtual Ubuntu and LDAP configuration Full network and web services management What you’ll learn Administer, install, and configure ...

    installing-asterisk-from-source

    【安装Asterisk从源代码】 在进行VoIP通信时,Asterisk是一个非常重要的开源PBX(Private Branch eXchange)系统,它支持多种协议,如SIP、PJSIP和WebRTC。本文主要讲解如何从源代码编译并安装Asterisk。...

    Requirements For Installing Oracle10gR2 On RHEL 5&OEL 5 (x86_64)

    ### 安装Oracle 10g R2在RHEL 5 & OEL 5 (x86_64)上的需求 #### 概述 本文档详细介绍了在Red Hat Enterprise Linux(RHEL)5和Oracle Enterprise Linux(OEL)5(x86_64架构)上安装Oracle 10g Release 2数据库的...

Global site tag (gtag.js) - Google Analytics