I have seen so many people around talking about testing different Ruby versions in Linux and OS/X.
What about using different Ruby versions in Windows?
I have been doing the job manually since the beginning, but there is a cool alternative.
It is a Multi-Ruby Manager for Windows.
A clever solution and there is extremely simple to get it working.
Let’s see:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Microsoft Windows XP [Version 5.1.2600] | |
(C) Copyright 1985-2001 Microsoft Corp. | |
C:\Documents and Settings\Ricardo>ruby -v | |
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] | |
C:\Documents and Settings\Ricardo>path | |
PATH=C:\WINDOWS;C:\WINDOWS\system32;D:\Ruby19\bin; | |
C:\Documents and Settings\Ricardo>d: | |
D:\>cd ruby19 | |
D:\Ruby19>gem install pik | |
---------------------------------------------------------------------------- | |
* If you're upgrading from a version <= 0.1.1, you'll want to delete the pik.bat file | |
from all of your ruby versions. Gem uninstall should do the trick. | |
* Install pik to a location that's in your path, but someplace other than your | |
ruby\bin dir | |
If you're upgrading from a more recent version, pik_install will overwrite the older files as needed. | |
>path | |
PATH=C:\tools\;C:\ruby\186-p368-mingw32\bin;C:\WINDOWS\system32;C:\WINDOWS | |
>pik_install C:\tools | |
* If this is a first-time install, add all the versions of ruby that you want to use with pik | |
>pik add | |
Adding: 186: ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mingw32] | |
Located at: c:/ruby/186-p368-mingw32/bin | |
>pik add C:\ruby\IronRuby-091\bin | |
Adding: 091: IronRuby 0.9.1.0 on .NET 2.0.0.0 | |
Located at: C:/ruby/IronRuby-091/bin | |
>pik add C:\ruby\jruby-1.4.0RC1\bin | |
Adding: 140: jruby 1.4.0RC1 (ruby 1.8.7 patchlevel 174) (2009-09-30 80c263b) (Java HotSpot(TM) Client VM 1.6.0_14) [x86-java] | |
Located at: C:/ruby/jruby-1.4.0RC1/bin | |
---------------------------------------------------------------------------- | |
Successfully installed highline-1.5.2 | |
Successfully installed pik-0.2.6 | |
2 gems installed | |
Installing ri documentation for highline-1.5.2... | |
Installing ri documentation for pik-0.2.6... | |
Updating class cache with 1080 classes... | |
Installing RDoc documentation for highline-1.5.2... | |
Installing RDoc documentation for pik-0.2.6... | |
Could not find main page README.rdoc | |
D:\Ruby19>pik_install C:\WINDOWS\system32 | |
Thank you for using pik. | |
Installing to C:\WINDOWS\system32 | |
cp D:/Ruby19/lib/ruby/gems/1.9.1/gems/pik-0.2.6/bin/../tools/pik.bat C:\WINDOWS\system32 | |
mkdir -p C:\WINDOWS\system32/pik | |
cp D:/Ruby19/lib/ruby/gems/1.9.1/gems/pik-0.2.6/bin/../tools/pik/pik_runner.exe | |
C:\WINDOWS\system32/pik | |
pik is installed | |
D:\Ruby19>pik list | |
creating C:\Documents and Settings\Ricardo\.pik | |
** Adding: 191: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] | |
Located at: D:\Ruby19\bin | |
191: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] * | |
D:\Ruby19>cd.. | |
D:\>dir ruby*. | |
Volume in drive D is Programas | |
Volume Serial Number is 04F0-8E6D | |
Directory of D:\ | |
28-Feb-2009 15:06 <DIR> Ruby186-111 | |
03-Jan-2009 09:33 <DIR> Ruby186-287 | |
29-May-2010 16:15 <DIR> Ruby186-398 | |
22-May-2010 20:15 <DIR> Ruby19 | |
0 File(s) 0 bytes | |
4 Dir(s) 10,305,060,864 bytes free | |
D:\>pik add d:\Ruby186-111\bin | |
** Adding: 186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] | |
Located at: d:\Ruby186-111\bin | |
D:\>pik add d:\Ruby186-287\bin | |
** Adding: 186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | |
Located at: d:\Ruby186-287\bin | |
D:\>pik add d:\Ruby186-398\bin | |
** Adding: 186: ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] | |
Located at: d:\Ruby186-398\bin | |
D:\>pik list | |
186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] | |
186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | |
186: ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] | |
191: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] * | |
D:\>pik sw 186 | |
Select which Ruby you want: | |
1. 186: ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] | |
2. 186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] | |
3. 186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | |
? 2 | |
D:\>pik list | |
186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] * | |
186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | |
186: ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] | |
191: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] | |
D:\>ruby -v | |
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] | |
D:\>path | |
PATH=C:\WINDOWS;C:\WINDOWS\system32;d:\Ruby186-111\bin; | |
D:\>pik sw 191 | |
D:\>path | |
PATH=C:\WINDOWS;C:\WINDOWS\system32;D:\Ruby19\bin; | |
D:\>pik list | |
186: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] | |
186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] | |
186: ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32] | |
191: ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] * | |
D:\> |