Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby version for production

I am developing for years with Ruby on Rails on Ruby 1.8.7 (Enterprise Edition). And there is 1.9.2 latest version.

What benefits can I get using 1.9.2? What about encoding support (I heard about some issues)? Is it faster? Is it more stable? etc

At the moment I am about to start a new project. So I am thinking about using 1.9.2 in production.

like image 751
fl00r Avatar asked May 10 '11 13:05

fl00r


3 Answers

My experience has with using 1.9.2 in production has been excellent. For a new project, esp. with Rails 3, I wouldn't recommend anything else. The Unicode support in 1.9 actually removes many, many, encoding headaches, plus 1.9.2 is quite a bit faster, and stability is a dream.

Of course, if you're migrating a project to 1.9.2, you wanna make sure you have good test coverage before you start, because there were changes, deprecations, etc.

For a really in-depth at the encoding issue, and what changed in 1.9.2, read this article by Yehuda Katz.

like image 68
Jason Lewis Avatar answered Sep 28 '22 06:09

Jason Lewis


If you are starting a new project, 1.9.2 has many advantages: encoding support, native threads and fibers, more consistent APIs.

But it does change things, so be aware. One that got me recently: Object#methods returns Strings in 1.8 and Symbols in 1.9.

See What is the difference between Ruby 1.8 and Ruby 1.9

like image 20
bheeshmar Avatar answered Sep 28 '22 06:09

bheeshmar


I am running a few projects now on 1.9.2 and as long as you keep yourself armed with rvm you should be good. The only problem that is giving me trouble at this point is the slow require which will be fixed in 1.9.3 coming out in a month or so.

Note that you also lose the advantages of REE if you use them (like copy-on-write friendliness), since it's not clear when REE will come out for YARV (if ever).

like image 31
Julik Avatar answered Sep 28 '22 06:09

Julik