Ruby 1.9.1 Library Compatibility Roundup
Ruby 1.9.1 is the first stable release of the 1.9.x series, and brings, among many language and standard library enhancements , significant performance improvements.
However, compatibility with existing code and Gems can be stumbling block when migrating to 1.9.1. There are different reasons for that. The ParseTree Gem, for instance, is not available because the new Ruby VM doesn't keep a Ruby parsetree around after the source code's parsed and compiled into bytecode. A partial replacement is available in the Ripper library shipped with 1.9.x (MacRuby, for instance, uses Ripper to parse Ruby sources for some purposes). Libraries that only require parsing of source code can get by with either Ripper or ruby_parser.
Another potential reason for compatibility problems are subtle changes in the language semantics, such as block variables which are now scoped properly, as well other changes.
Whatever the reasons, the release of 1.9 in 2007, and more so the release of 1.9.1 earlier this year has now caused increased attention to getting libraries ready for 1.9.x.
According to many reports, Rails 2.3 (or Rails Edge) appears to be 1.9.x compatible, earlier releases seem to have problems. Ryan Bigg detailed a list of issues that come up with using Rails on 1.9.1. The Phusion Passenger blog reports that their most recent version is compatible with 1.9.1, and detail which libraries they had to update or patch to make this work. Some database adapters are read, such as the MySQL adapter released version 2.8.1 which is supposed to work with Ruby 1.9.1.
An interesting solution to determining compatibility information is available at http://isitruby19.com/. The site lists Ruby Gems and allows users to report their experiences with compatibility. A nice feature is a green and a red bar next to the name of the Gem, which show the number of user reports of success or failure of this Gem on 1.9.
The results should be taken with a grain of salt though, particularly Gems with only one user report. At publication time of this news item, the ParseTree Gem was reported as "Working", something contradicted by an earlier message by Ryan Davis, the creator of ParseTree. Also, a quick test run of ParseTree in a Ruby 1.9.1 instance fails with
': ParseTree doesn't work with ruby 1.9.1
Nevertheless, http://isitruby19.com is one place to start when looking for compatibility answers.
What's holding you back from migrating to Ruby 1.9.1?
Srini Penchikala Aug 21, 2014