8

I'm seeking a more streamlined and robust approach to keeping my rvm environment intact after an OS update. I'm using Mountain Lion, rvm 1.18.16 and homebrew, which has readline, gettext, libxml2, libxslt, qt, gtk+ -- the gems that usually break for me are nokogiri and capybara-webkit

Twice now after updating Mountain Lion and XCode, my native extension gems and Ruby have suffered breakage and I have to spend time getting everything working again. I have to wonder if I'm following the best practice for getting all the rvm components updated after such system update.

What typically happens is that gems with native extensions are linking against old libraries that are no longer available, especially with the libxml issues surrounding Mountain Lion. Here's the basic steps I take to get my system back online across all projects (I have about 8 versions of Ruby installed under rvm, so this is tedious!).

First, update Mountain Lion and XCode via the App Store.

Second, Update homebrew with:

brew update
brew upgrade

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

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

NOTE: I did try:

rvm all do reinstall

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

Next up, step through each ruby and perform pristine on the gems (this has side effect of recompiling all native extension gems):

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

Finally, go to each project and perform the following:

bundle install

I'm not sure if that last step is strictly necessary -- some projects seemed to be ok, some weren't, but running this seemed to clear up last remaining issues.

Surely there's a more streamlined way to manage this process!? I've only been using both Mountain Lion and rvm for a couple months, but in that time, two system updates have killed most of my working Ruby environment. I have a lot of Ruby versions installed because of my job as a consultant and encountering many development environments, so I'd really like to get this down to an easily repeatable process.

Any thoughts? Can the above be further improved?

1
  • From mpapis on IRC #rvm: If you're not using --path or --deployment command options with bundle, then the rvm reinstall all will also clear up issues with each project's bundled gems. Mar 8, 2013 at 16:43

1 Answer 1

16

You can do:

rvm reinstall all

append --force to skip the questions.

Note that will do full reinstall including gem pristine of every gem, you need to pay attention to the output as it will notify you about the gems that failed to executes the pristine action.

4
  • 1
    Interesting! That's not even listed as an Action when you run rvm without any arguments. Its also apparently not a documented command on the rvm.io/rubies/installing page (nor others that I checked)...so that begs the question...where's it documented? Mar 8, 2013 at 14:55
  • 1
    yeah, that was experimental feature and I missed to document it, will try to add it to help
    – mpapis
    Mar 8, 2013 at 15:23
  • 1
    Thanks for your input on #irc. I've submitted ticket for this Mar 8, 2013 at 16:41
  • I'm getting the error "Unknown ruby interpreter version (do not know how to handle): all.".
    – nbro
    Oct 20, 2021 at 23:19

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.