Ruby Enterprise Editionのインストール

環境
CentOS 5.5 (Final)
Amazon Linux 2010.11.1 (beta)


念のため、既存のyumパッケージをアップデートしておきます。

# yum check-update
# yum update


開発ツール一式(GCCなど)をインストールします。

# yum groupinstall "Development Tools"


ビルドに必要なライブラリのヘッダファイルをインストールします。

# yum install openssl-devel readline-devel zlib-devel mysql-devel


Ruby Enterprise Editionの最新版をダウンロードします。最新版はこちら

# cd /usr/local/src
# wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz


ダウンロードしたtarballを解凍します。

# tar zxvf ruby-enterprise-1.8.7-2010.02.tar.gz


そのままインストールすると、最新版のRailsなどいくつかのgemも併せてインストールされます。余計なものをインストールしたくない場合は、--dont-install-useful-gemオプションを指定してください。ただしRuby Enterprise Edition 2010.02では、--dont-install-useful-gemオプションを指定すると「Installing useful libraries...」セクションでエラーが発生するため、修正パッチを適用する必要があります。修正パッチはこちら

# cd ruby-enterprise-1.8.7-2010.02
# patch -p0 < ruby-enterprise-1.8.7-2010.02.issue42.patch
# cd ..


インストーラを実行します。途中でインストール先を尋ねられるので(Target directory)、必要に応じてディレクトリを指定します(以下ではインストール先を/usr/localに変更しています)。また、./ruby-enterprise-1.8.7-2010.02/installer --helpでインストーラのヘルプを表示できます。

# ./ruby-enterprise-1.8.7-2010.02/installer --no-dev-docs --dont-install-useful-gems
Welcome to the Ruby Enterprise Edition installer
This installer will help you install Ruby Enterprise Edition 1.8.7-2010.02.
Don't worry, none of your system files will be touched if you don't want them
to, so there is no risk that things will screw up.

You can expect this from the installation process:

  1. Ruby Enterprise Edition will be compiled and optimized for speed for this
     system.
  2. Ruby on Rails will be installed for Ruby Enterprise Edition.
  3. You will learn how to tell Phusion Passenger to use Ruby Enterprise
     Edition instead of regular Ruby.

インストールを継続するか尋ねられるので、Enterキーを押して継続します
Press Enter to continue, or Ctrl-C to abort.

Checking for required software...

 * C compiler... found at /usr/bin/gcc
 * C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * The 'patch' tool... found at /usr/bin/patch
 * Zlib development headers... found
 * OpenSSL development headers... found
 * GNU Readline development headers... found

Target directory

Where would you like to install Ruby Enterprise Edition to?
(All Ruby Enterprise Edition files will be put inside that directory.)

インストール先を尋ねられるので、必要に応じてディレクトリを指定します
[/opt/ruby-enterprise-1.8.7-2010.02] : /usr/local

Compiling and optimizing the memory allocator for Ruby Enterprise Edition
In the mean time, feel free to grab a cup of coffee.

./configure --prefix=/usr/local --disable-dependency-tracking
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...


gemを最新版にアップデートしておきます。

# gem update --system


無事にインストールされました。

# ruby --version
ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02
# gem --version
1.4.2