2011年10月21日金曜日

ruby1.8.7 ruby1.9.2 ironruby devkit 最新版入替メモ

Ruby 1.9.2-p180>uninstall ruby 1.9.2-p180 の実行
rubyinstaller-1.9.2-p290.exe の実行
Ruby 1.8.7-p334>uninstall ruby 1.8.7-p334 の実行
rubyinstaller-1.8.7-p352.exe の実行
IronRuby 1.1>Uninstall IronRuby
IronRuby.msi の実行
Ruby 1.9.2-p290>Start Command Prompt with Ruby

C:\Documents and Settings\takashi>pik list
112: IronRuby 1.1.2.0 on .NET 4.0.30319.1
187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
* 192: ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

C:\Documents and Settings\takashi>pik rm 192
Are you sure you'd like to remove '192: ruby 1.9.2p180 (2011-02-18) [i386-mingw32]'? |yes|
y
192: ruby 1.9.2p180 (2011-02-18) [i386-mingw32] removed.

C:\Documents and Settings\takashi>pik add c:\ruby\ruby192\bin
** Adding: 192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
Located at: C:\ruby\ruby192\bin

C:\Documents and Settings\takashi>pik rm 187
Are you sure you'd like to remove '187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]'? |yes|
y
187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32] removed.

C:\Documents and Settings\takashi>pik add c:\ruby\ruby187\bin
** Adding: 187: ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
Located at: C:\ruby\ruby187\bin

C:\Documents and Settings\takashi>pik rm 112
Are you sure you'd like to remove '112: IronRuby 1.1.2.0 on .NET 4.0.30319.1'? |yes|
y
112: IronRuby 1.1.2.0 on .NET 4.0.30319.1 removed.

C:\Documents and Settings\takashi>pik add "C:\Program Files\IronRuby 1.1\bin"
** Adding: 113: IronRuby 1.1.3.0 on .NET 4.0.30319.239
Located at: C:\Program Files\IronRuby 1.1\bin

C:\Documents and Settings\takashi>pik list
113: IronRuby 1.1.3.0 on .NET 4.0.30319.239
187: ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
* 192: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

C:\Documents and Settings\takashi>cd c:\rubyapi

C:\rubyapi>type fib39.rb
class Integer
def fib
return self if self < 2
(self-2).fib + (self-1).fib
end
end

n = 39
start = Time.now
res = n.fib
puts "", res, (Time.now - start).to_s + " sec"

C:\rubyapi>pik bench fib39.rb
IronRuby 1.1.3.0 on .NET 4.0.30319.239

Rehearsal --------------------------------------------------------------
** benchmarking 'fib39.rb'
63245986
219.015625 sec
214.890625 3.640625 218.531250 (219.078125)
--------------------------------------------------- total: 218.531250sec

user system total real
** benchmarking 'fib39.rb'
63245986
230.96875 sec
223.687500 4.234375 227.921875 (230.984375)

ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]

Rehearsal --------------------------------------------------------------
** benchmarking 'fib39.rb'
63245986
303.078125 sec
302.157000 0.000000 302.157000 (303.093750)
--------------------------------------------------- total: 302.157000sec

user system total real
** benchmarking 'fib39.rb'
63245986
301.71875 sec
301.031000 0.016000 301.047000 (301.750000)

ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

Rehearsal --------------------------------------------------------------
** benchmarking 'fib39.rb'
63245986
91.28125 sec
91.047000 0.000000 91.047000 ( 91.296875)
---------------------------------------------------- total: 91.047000sec

user system total real
** benchmarking 'fib39.rb'
63245986
91.234375 sec
90.906000 0.015000 90.921000 ( 91.250000)


C:\rubyapi>

c:\ruby\DevKit\ の下をすべて削除する
DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe を実行して
c:\ruby\DevKit\ の下に展開する

C:\rubyapi>cd c:\ruby\devkit

C:\ruby\DevKit>ruby dk.rb init
[INFO] found RubyInstaller v1.8.7 at C:/ruby/Ruby187
[INFO] found RubyInstaller v1.9.2 at C:/ruby/Ruby192

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

C:\ruby\DevKit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

C:/ruby/Ruby187
C:/ruby/Ruby192

C:\ruby\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/ruby/Ruby187'
[WARN] Skipping existing DevKit helper library for 'C:/ruby/Ruby187'
[INFO] Updating convenience notice gem override for 'C:/ruby/Ruby192'
[WARN] Skipping existing DevKit helper library for 'C:/ruby/Ruby192'

C:\ruby\DevKit>gem install rdiscount --platform=ruby
Fetching: rdiscount-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rdiscount-1.6.8
1 gem installed
Installing ri documentation for rdiscount-1.6.8...
Installing RDoc documentation for rdiscount-1.6.8...

C:\ruby\DevKit>ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html"

Hello RubyInstaller


C:\ruby\DevKit>

0 件のコメント:

コメントを投稿