13

My ruby version is

ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

and I am running under Windows 8 with mingw installed.

How can I upgrade it to ruby 2.0 ?

Ritesh Kumar
  • 2,183
  • 2
  • 20
  • 32
Znatz
  • 1,530
  • 2
  • 18
  • 31

3 Answers3

17

Pik let you play with and manage multiple versions and flavours of ruby on on your Windows box. I have chosen this way because I'm not sure that everything I need will work on the first try with the new version, hence I want also to keep prior versions.

The installation is also simple: if you haven't jet Pik see topic: "Install pik using rubygems" then "pik install ruby 2.0.0"

for example:

Before

C:\Sites>pik list
  160: jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java H...
  165: jruby 1.6.5.1 (ruby-1.9.2-p312) (2012-01-25 fffffff) (Java HotSpot(T...
  167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)...
  187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  192: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
* 193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

Install

C:\Sites>pik install ruby 2.0.0
** Downloading:  http://rubyforge.org/frs/download.php/76807/ruby-2.0.0-p0-i386-
mingw32.7z
...

After installation

C:\Sites>pik list
  160: jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java H...
  165: jruby 1.6.5.1 (ruby-1.9.2-p312) (2012-01-25 fffffff) (Java HotSpot(T...
  167: jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM)...
  187: ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
  192: ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
* 193: ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
  200: ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

Now we can use version 2.0.0

C:\Sites>pik use 200

C:\Sites>ruby --version
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]

Wondering where the hell are the Ruby folders

 C:\>echo %HOME%
 C:\Users\rondinif

 C:\>where ruby 
 C:\Users\rondinif\.pik\rubies\Ruby-200-p0\bin\ruby.exe

 C:\>pik use 193
 C:\>where ruby 
 C:\RailsInstaller\Ruby1.9.3\bin\ruby.exe

 C:\>pik use 167
 C:\>where ruby 
     INFO: Could not find files for the given pattern(s).
 C:\>where jruby
 C:\Users\rondinif\.pik\rubies\JRuby-167\bin\jruby

and so on...

Community
  • 1
  • 1
Franco Rondini
  • 10,841
  • 8
  • 51
  • 77
  • 1
    Wonderful. I followed the instruction and now I am tasting the latest ruby. Thank you! – Znatz Mar 24 '13 at 15:02
  • There is another problem. When I run irb, it gives me this error, DL is deprecated, please use Fiddle – Znatz Mar 24 '13 at 15:28
  • 2
    @Znatz I'm glad this works for you so you can accept my answer :-) ..Please see also the answer I Gave to [“DL is deprecated, please use Fiddle”](http://stackoverflow.com/a/15601984/1657028) question. – Franco Rondini Mar 24 '13 at 18:06
  • 1
    Well, `pik install ruby`, `pik config installs` and `pik config downloads` shows errors, but rest I used `pik add LOCATION` and everything worked very easily, so +1 – Darek Nędza Jan 14 '14 at 20:01
  • @FrancoRondini I install ruby 2.0.0 using pik, but I am wondering, where is the folder Ruby 2.0? I need that for config.yml in devkit. Thanks – ishwr Feb 06 '14 at 11:38
  • @catwoman have a look to your %HOME%\.pik\rubies\Ruby-200-p0\ or something like that; please see the last "edit" to the answer – Franco Rondini Feb 06 '14 at 13:46
  • Pik is no longer maintained: https://github.com/vertiginous/pik/commit/13e5cc2d0a78d821e7c5d4255e86f6a9ca7f24fc – yegor256 Dec 24 '15 at 08:18
4

Just install ruby version 2.0 from the official rubyinstaller site.

There's nothing like 'upgrade'. You can actually run both versions on ur PC at the same time (many people prefer that too). Also refer to this question: How to have multiple versions of Ruby AND Rails, and their combinations on Windows?

Community
  • 1
  • 1
Bharadwaj Srigiriraju
  • 2,196
  • 4
  • 25
  • 45
2

Well you could just try building it from source, just like how you installed 1.9.3. Personally I would recommend using something like RubyInstaller or better still doing Ruby development inside a Linux VM.

Sahil Muthoo
  • 12,033
  • 2
  • 29
  • 38