multiruby
すでにいろんなバージョンの Ruby はインストール済みなのですが、テストやちょっとした確認時に便利そうなので multiruby をインストールしてみました。
まず、ZenTest がはいっていることを確認。
% gem list --local ZenTest *** LOCAL GEMS *** ZenTest (3.11.1)
ヘルプをみてみます。ふむふむ。
MRI 以外に Rubinius が扱えますし、ほかの実装にも対応していくみたいですね。
% multiruby_setup -h multiruby_setup is a script to help you manage multiruby. usage: multiruby_setup [-h|cmd|spec...] cmds: h, help - show this help. list - print installed versions. update - update svn builds. update:rubygems - update rubygems and nuke install dirs. rubygems:merge - symlink all rubygem dirs to one dir. rm:$version - remove a particular version. clean - clean scm build dirs and remove non-scm build dirs. specs: mri:svn:current - alias for mri:svn:releases and mri:svn:branches. mri:svn:releases - alias for supported releases of mri ruby. mri:svn:branches - alias for active branches of mri ruby. mri:svn:branch:$branch - install a specific $branch of mri from svn. mri:svn:tag:$tag - install a specific $tag of mri from svn. mri:tar:$version - install a specific $version of mri from tarball. rbx:ln:$dir - symlink your rbx $dir rbx:git:current - install rbx from git NOTES: * you can add a symlink to your rubinius build into ~/.multiruby/install * I'll get to adding support for other implementations soon.
とりあえず、セットアップコマンドを打ってみます。
% multiruby_setup mri:svn:current ... (snip) # checking out from svn repository ... building and installing mri_1_8 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/mri_1_8 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install building and installing mri_1_8_6 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/mri_1_8_6 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install building and installing mri_1_8_7 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/mri_1_8_7 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install building and installing mri_rel_1_8_6 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/mri_rel_1_8_6 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install building and installing mri_rel_1_8_7 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/mri_rel_1_8_7 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install building and installing mri_rel_1_9 /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:87:in `build_and_install': dunno how to build (RuntimeError) from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:80:in `chdir' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:80:in `build_and_install' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:61:in `each' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:61:in `build_and_install' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:60:in `chdir' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:60:in `build_and_install' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:53:in `chdir' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/lib/multiruby.rb:53:in `build_and_install' from /var/lib/gems/1.8/gems/ZenTest-3.11.1/bin/multiruby_setup:68 from /usr/bin/multiruby_setup:19:in `load' from /usr/bin/multiruby_setup:19
1.9 でこけました... orz
気をとりなおして、tags から取得するようにしてみます。
% multiruby_setup mri:svn:tag:v1_9_1_0 Running command: svn co http://svn.ruby-lang.org/repos/ruby/tags/v1_9_1_0 v1_9_1_0 ... (snip) ... Checked out revision 22068. building and installing v1_9_1_0 Running command: autoconf Running command: ./configure --prefix /Users/kiwamu/.multiruby/install/v1_9_1_0 &> log.configure Running command: nice make -j4 &> log.build Running command: make install &> log.install
今後は無事インストールできたようです。 :-)
試しに 1.8系と1.9系で挙動の違うものを実行してみます。
% multiruby -e 'p ?a' VERSION = mri_1_8 CMD = ~/.multiruby/install/mri_1_8/bin/ruby -e p ?a 97 RESULT = 0 VERSION = mri_1_8_6 CMD = ~/.multiruby/install/mri_1_8_6/bin/ruby -e p ?a 97 RESULT = 0 VERSION = mri_1_8_7 CMD = ~/.multiruby/install/mri_1_8_7/bin/ruby -e p ?a 97 RESULT = 0 VERSION = mri_rel_1_8_6 CMD = ~/.multiruby/install/mri_rel_1_8_6/bin/ruby -e p ?a 97 RESULT = 0 VERSION = mri_rel_1_8_7 CMD = ~/.multiruby/install/mri_rel_1_8_7/bin/ruby -e p ?a 97 RESULT = 0 VERSION = mri_trunk CMD = ~/.multiruby/install/mri_trunk/bin/ruby -e p ?a "a" RESULT = 0 VERSION = v1_9_1_0 CMD = ~/.multiruby/install/v1_9_1_0/bin/ruby -e p ?a "a" RESULT = 0 TOTAL RESULT = 0 failures out of 7 Passed: mri_rel_1_8_6, mri_1_8_7, mri_rel_1_8_7, mri_trunk, mri_1_8, v1_9_1_0, mri_1_8_6 Failed: