Ruby 1.9: Not For Rails

   By chris on December 30th 2007 in /dev/rails, /dev/ruby | 3,778 views

Do NOT install or upgrade to Ruby 1.9 if you’re using Ruby for Rails development.

There, that warning ought to suffice.

On Dec. 25 Matz announced that a development release of Ruby 1.9 was available in which the Ruby 1.9 spec has been frozen:

We are happy to announce of the release of the 1.9.0 the development
release.

We hope this helps you to enjoy hacking. Happy Holidays.

matz.

However, Ruby 1.9.0 is not a drop-in replacement for Ruby 1.8.* with more good stuff inside, many fundamentals have changed, often in incompatible ways. As Dave “PickAxe” Thomas notes:

This is a development release, not a production release. It has known bugs, and there’ll be more to come.

It contains several incompatible changes (block parameters are now block-local, String is no longer Enumerable, “cat”[1] now returns “a”, rather than 65)

It is more rigorous that 1.8 when it comes to detecting invalid code. For example, 1.8 accepts /[^\x00-\xa0]/u, while 1.9 complains of invalid multibyte escape

the likes of which are guaranteed to break either Rails, some critical gem, a required plugin or your own code. Honestly, it’s guaranteed.

As example from the Rails list:

just now i installed ruby 1.9 and rails 2.0.2 on it. when i create new rails application

username@ubuntu7.04:~/project$ rails app
can’t convert Enumerable::Enumerator into Array

and

Agreed. I just upgraded to 1.9 and found all my applications totally
hosed. I had to delete 1.9 and reinstall 1.8.6, along with Ruby Gems (on
Leopard).

I’ll be waiting for the official announcement of compatibility on the
Rails blog.

and from Rick DeNatale:

I just answered a post from someone on the TextMate forum who
installed Ruby1.9 as ruby. Now he gets a syntax error inside textmate
when he tries to run a ruby program, since Textmate uses ruby
internally, and some of that code ran into one of the syntax
incompatibilities.

Anyway, you get the idea.

If you really want to play around with Ruby 1.9, perhaps to help with the testing or just to get an idea of what cool stuff will be landing in Ruby 2.0, Dave Thomas’ post, cited above, provides great details in just how to do that.

Congrats to Matz and all the ruby-core team on 1.9.

Update: Should you need even more proof of the current “dev” state of Ruby 1.9.0, a fairly significant string encoding bug was bound found, isolated and fixed just four days after release.

Trackback URI | Comments RSS

Leave a Reply