Mikko Vedru
Mikko Vedru

Reputation: 353

Updating Ruby 1.9.3 -> 2.0.0 without losing gems

Have had 1.9.3p194 (RubyInstaller) with Ruby on Rails and all kinds of Gems installed on my WinXP. Now I want to update the whole setup.

Updating RoR (to 4.0.0) and gems was easy: gem update rails, gem update --system, gem update.

But how do I do that with Ruby? Is there an easy way to update the installation?

If not, and I have to install the fresh package, then how do I do it with little hassle?

I have downloaded the fresh 2.0 RubyInstaller. I have read that I shouldn't install this new Ruby version in the same directory as my old Ruby version (c:\programs\Ruby) that's why I chose a c:\programs\Ruby200 directory. During the installation I clicked on every additional setting, including the "include new directory in the PATH variable" type of choice. But now when I type ruby -v I still get 1.9.3p194 and the new directory is absent from PATH (I haven't rebooted, so maybe this has something to do with it).

So how should I really install the new version? Should I simply change the old PATH to the new one? Or should I instead only add the new one without removing the old path (so there will be some kind of advantage of having both 1.9.3 and 2.0)? Or should I simply delete both installations and install 2.0 from the start?

How do I easily transfer the gems (or the list of them, so the gem update could handle the installation/updating) from my old installation to the new one?

I am using JetBrains RubyMine 5.4 editor, and would like to know if I need to do something there as well (for both the new and the existing projects).

Upvotes: 2

Views: 1388

Answers (1)

gregates
gregates

Reputation: 6724

Like many POSIX users, I rely on rvm and bundler to manage ruby versions & gemsets. Unfortunately, rvm is not available on windows. Although I haven't tried it personally, it looks like pik is a viable windows alternative. I would recommend checking that out.

You should also definitely look into bundler if you're not already using it; since bundler is just a gem, it should be platform independent.

Upvotes: 1

Related Questions