1. Aug 13th, 2009

    I switched to Ruby 1.9 (and you should too)

    My computer has two flavors of Ruby: good old 1.8.6 that ships with OS X, and 1.9.1 that I installed with MacPorts.

    Until yesterday, I was chicken on 1.9.1, not pig. Most times I would remember to run 1.9 commands. Other times, I would be running 1.8 (e.g. Rails’s script/console insist on using the ruby command, which fires up 1.8.6).

    I hedged writing code that works on both flavors. Until yesterday.

    Step 1: Went and uninstalled all the gems in the 1.8 repository. Can’t do much with an empty repository, if I end up running 1.8 by mistake, it will fail early.

    Step 2: Symlinked /usr/bin/ruby, irb, rdoc and other Ruby commands to their 1.9 counterparts located in /opt/local/bin. Now everything that tries to run Ruby runs 1.9.1.

    Step 3: Going to start writing some code to take advantage of new language features and idioms.

    Based on an informal poll of two people at tonight’s SF Ruby Meetup event, I’m not alone. It’s still not smooth sailing and you have to give up on the occasional gem or fork a fix (Github makes that easy). In the long run, it’s worth the effort.

    When did you make the switch?

    1. Aug 13th, 2009

      Jack Dempsey

      Haven’t made the full switch yet. I don’t think I have the time right now to deal with the potential issues of making the switch, but maybe it wouldn’t be that bad.

      I’ve used Chad Humphries excellent config repo at github to help install and switch between versions though (as an aside, if you’re interested in z-shell, take a look at this repo as well):

      http://github.com/spicycode/spicy-config/blob/7e6088e0fec8c41f1977e6c703550bd4e280583e/.zsh/ruby_installer.zsh

      http://github.com/spicycode/spicy-config/blob/7e6088e0fec8c41f1977e6c703550bd4e280583e/.zsh/ruby_switcher.zsh

    2. Aug 14th, 2009

      Assaf

      Cool links, thanks for sharing.

    3. Aug 14th, 2009

      Carlo Zottmann

      Tried to switch while working on some Rails projects, and ran head-first into a few walls, mostly related to I18n issues and plugins.

      Which makes me a sad panda.

    4. Aug 14th, 2009

      Assaf

      I heard there were UTF-8/ASCII issues that plagued Rails earlier on, but those are resolved now. I didn’t get to experience them myself, but then I’m a late starter on 1.9. Sadly yes, you have to give up on some plugins/gems, or fork and fix them (not as easy as it sounds).

    5. Aug 17th, 2009

      daeltar

      UTF-8/ASCII issues are showstoppers, far way to resolve them all.

    Your comment, here ⇓