2012年11月3日土曜日

rvmでRubyをインストールする時の注意

事情あって複数バージョンのRuby環境を導入するはめになった。
rvmを利用します。MacBookAirにはデフォルトで用意されている。多分。

   $rvm list known
現在時点で実行すると以下の様なインストールできるリストが表示されます。
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7-p370
[ruby-]1.8.7[-p371]
[ruby-]1.9.1[-p431]
[ruby-]1.9.2-p180
[ruby-]1.9.2-p290
[ruby-]1.9.2-p318
[ruby-]1.9.2[-p320]
[ruby-]1.9.2-head
[ruby-]1.9.3-preview1
[ruby-]1.9.3-rc1
[ruby-]1.9.3-p0
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-[p286]
[ruby-]1.9.3-head
ruby-head

# GoRuby
goruby

# TheCodeShop - MRI experimental patches
tcs

# JRuby
jruby-1.2.0
jruby-1.3.1
jruby-1.4.0
jruby-1.6.5
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7
jruby-1.6.7.2
jruby-1.6.8
jruby-[1.7.0]
jruby-head

# Rubinius
rbx-1.0.1
rbx-1.1.1
rbx-1.2.3
rbx-1.2.4
rbx[-head]
rbx-2.0.testing

# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]

# Kiji
kiji

# MagLev
maglev[-head]
maglev-1.0.0

# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head

# IronRuby -- Not implemented yet.
ironruby-0.9.3
ironruby-1.0-rc2
ironruby-head
Ruby1.8.6と1.8.7が必要だったので上記のリストを見ながら導入します。 []は省くことができるようです。
   $rvm install 1.8.6
No binary rubies available for: osx/10.7/x86_64/ruby-1.8.6-p420.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
怒られた…gccが気に喰わぬといった雰囲気です。いじりましたが以下の方法で解決できました。
$rvm install 1.8.6 --with-gcc=clang