Best way to update all rubies and gems of RVM after updating the system?

I am looking for a more optimized and reliable approach to keep my rvm environment unchanged after updating the OS. I use Mountain Lion, rvm 1.18.16 and homebrew, which has readline, gettext, libxml2, libxslt, qt, gtk + - the jewels that usually break for me are nokogiri and capybara-webkit

Twice after upgrading Mountain Lion and Xcode, my native nuggets and Ruby crashed, and I have to spend time getting everything working again. I need to wonder if I am following the best practice for updating all rvm components after such a system update.

What usually happens is that gems with native extensions are associated with old libraries that are no longer available, especially with the libxml problems surrounding Mountain Lion. Here are the basic steps I'm taking to get my system back online in all projects (I have about 8 versions of Ruby installed under rvm, so this is tedious!).

First upgrade Mountain Lion and Xcode through the App Store.

Secondly, update homebrew with

brew update brew upgrade 

Then list your rubies and start recompiling each with ...

 rvm list rvm reinstall ruby-1.9.2-p290 rvm reinstall ruby-1.9.3-p392 ... 

NOTE. I tried:

 rvm all do reinstall 

but it gave me this error: "reinstall: command not found"

Next, go through each ruby ​​and perform virgin traits on the gems (this has the side effect of recompiling all the native gems):

 rvm use ruby-1.9.3-p392 gem pristine --all 

Finally, go to each project and do the following:

 bundle install 

I’m not sure that this last step is absolutely necessary - some projects looked fine and some didn’t, but launching this seemed to clear up the last remaining problems.

Of course, there is a more optimized way to manage this process !? I only used Mountain Lion and rvm for a couple of months, but during this time two system updates killed most of my Ruby workspace. I have many versions of Ruby installed because of my work as a consultant and found in many development environments, so I would really like this to be an easily reproducible process.

Any thoughts? Is it possible to improve it higher?

+7
source share
1 answer

You can do:

 rvm reinstall all 

append --force to skip questions.

Please note that for a complete reinstallation, including the gem pristine each gem, you should pay attention to the result, as it will notify you of gems that did not perform the pristine action.

+11
source

All Articles