1.1. Ruby in Version 1.8.x, 1.9.2 or 1.9.3?

Quick answer: Please use Ruby 1.9.3 or 1.9.2.
Many books and documentations that you have already seen will also work with Ruby 1.8.x. So why on earth do we now make such a fuss, and why don't we just use Ruby 1.8.x – which, with a bit of luck, is already installed on your system? Purely mathematically, the difference between 1.9.2 or 1.9.3 and 1.8.x is not all that great (the number 1.9 is only about 5 % bigger than 1.8)?!
Here is why:
  • The difference between Ruby 1.9.x and Ruby 1.8.x is enormous. Do not be fooled by the version number alone. To mention just the simplest argument: Ruby 1.9.3 performs much better than Ruby 1.8.x. In what sense better? Depending on the benchmark, it's 2 to 6 times faster (in certain areas, even factor 10 and more).
  • Many Rails authors originate from English-speaking countries, where you can manage quite well with Ruby 1.8.x and US-ASCII. But for all other languages, it's not looking quite so rosy. Only version 1.9.x onwards offers a good multi-encoding environment. You could even say that Ruby 1.9.x is way ahead of pretty much every other programming language in this respect.[1]
  • Rails 4 will no longer work with Ruby 1.8.x. So you are closing the doors to upgrade options.[2]

[1] The moderate handling of UTF-8 and Co. in Ruby 1.8 is almost ironic. After all, the inventor of Ruby (Yukihiro Matsumoto a.k.a. Matz) is Japanese, so we could well expect to find support for more than just ASCII. The reason for implementing the support so late has to do with the arrogant way of developing UTF-8 or UTF-16. The corresponding committees did not initially feel compelled to take a closer look at the Asian writing culture. As a result, the first version was alright for European fonts, but a complete joke for Asian cultures. It was fixed later on, and Ruby moved along with it. The multi-encoding support in Ruby 1.9 is now so good that you can only look down in pity at other programming languages.

[2] See also https://twitter.com/#!/dhh/status/54618472692449280 tweet by David Heinemeier Hansson: As a general note, if you're starting a new Rails app, you should be running Ruby 1.9.2. Rails 4 will require it. Ruby 1.8.x is legacy.

Updates about this book will be published on my Twitter feed.