close
The Wayback Machine - https://web.archive.org/web/20081202082934/http://weblog.rubyonrails.org:80/2008/11/21/rails-2-2-i18n-http-validators-thread-safety-jruby-1-9-compatibility-docs

Rails 2.2: i18n, HTTP validators, thread safety, JRuby/1.9 compatibility, docs

Posted by David November 21, 2008 @ 05:22 PM

Rails 2.2 is finally done after we cleared the last issues from the release candidate program. This release contains an long list of fixes, improvements, and additions that’ll make everything Rails smoother and better, but we also have a number of star player features to parade this time.

Internationalization by default
The most important is that Rails now includes a full-on internationalization framework and that it’s pre-wired from start. The work of the i18n group has been very impressive and it’s great to see that Rails finally ships with a solution in the box that’s both simple and extensible. Great job, guys!

Stronger etag and last-modified support
We’ve also added much better support for HTTP validators in the form of etag and last-modified. Making it so much easier to skip expensive procesesing if the client already has the latest stuff. This also makes it even easier to use Rails with gateway proxies.

Thread safety and a connection pool
Josh Peek has added thread safety to Rails and Nick Sieger from JRuby worked on getting Active Record a proper connection pool. So now all elements of Rails are thread safe, which is a big boon for the JRuby guys in particular. For C Ruby, we still need a bunch of dependent libraries to go non-blocking before it’ll make much of a difference, but work on that is forth coming.

Ruby 1.9 and JRuby compatibility
Jeremy Kemper has been rocking on both Ruby 1.9 and JRuby compatibility. Rails 2.2 is fully compatible with both, but again, there might be supporting libraries and gems that are not. Again, lots of work is going into making everything else fully compatible as well.

Better API docs, great guides
Finally, the last big push has been with the documentation of Rails. Pratik’s docrails project has made immense progress. Not only are the API docs much improved, but we also have a whole new guides section generated from documentation that now lives with the source. A true community project with lots of contributors. I’m sure both those new and old to Rails will greatly appreciate the strong focus on documentation.

To read about all these features and more in details, checkout the Rails 2.2 release notes—another one of those guides from the docrails project.

How to install
As always, you can install Rails 2.2 through RubyGems. We now require RubyGems 1.3.1, so be sure to update that first: gem update --system

Then you can install Rails: gem install rails

If you’re updating an existing application, you can run rake rails:update to get the latest JavaScript files and scripts.

From all of us to all of you, we hope you enjoy this release. It’s a true pleasure to see Rails make such big steps forward once again. Dig in, have fun, and we’ll be back with Rails 2.3 with even more before you know it.

Posted in Releases | 95 comments

Comments

  1. Fabio Espindula on 21 Nov 19:49:

    cool ;)

  2. Nicholas Henry on 21 Nov 19:50:

    A big thanks to the core team and all contributors!

  3. aimee.mychores.co.uk on 21 Nov 19:50:

    Woohoo! Congratulations!

    I’ve been trying out 2.2 this week on one project, and enjoyed what i’ve seen.

    Now roll on 2.3 (or 3.0) because i cannot wait for default_scope and new-improved partial rendering! :)

  4. wes on 21 Nov 19:52:

    congrats to you all! thanks for all your work.

  5. Brian Doll on 21 Nov 19:52:

    A hundred million thank you’s to the ever growing number of contributors in both features and documentation. Here’s to the best version yet… and on to the next!

  6. Sven Fuchs on 21 Nov 19:53:

    Awesome. bitsweat, dhh and nkoz, in the name of the rails i18n team, lemme thank you for finally making this possible.

  7. TaQ on 21 Nov 19:53:

    Sweet! :-)

  8. dmitry on 21 Nov 19:54:

    cool!

  9. PJ Davis on 21 Nov 19:55:

    Sweet! Looking forward to Array#forty_two ;)

  10. Pelle on 21 Nov 19:56:

    Great news David and team.

    Congratulations on the release. Rails has sure come a long way from when I first started using it 4 years ago.

    Don’t know what my favorite features is: internationalization or thread safety.

  11. MitkOK on 21 Nov 19:56:

    Nice work guys !

  12. leethal on 21 Nov 19:58:
  13. jlecour on 21 Nov 20:03:

    Great !

    I’ve been following/trying the RCs, … for weeks. It’s so good to have a finished/polished product to use.

    Thanks everyone

  14. Mike McKinney on 21 Nov 20:03:

    Congrats to all, tremendous advances indeed

  15. Stefan Koenig on 21 Nov 20:04:

    Thanks, I’ll really enjoy the internationalization.

  16. Attila Györffy on 21 Nov 20:06:

    “We now require RubyGems 1.3.1, so be sure to update that first: gem update—system”

    $ sudo gem update—system Password: Updating RubyGems Nothing to update

    $ gem -v 1.2.0

    Even having v1.2.0 only I could manage to install the gems.

    How come it does not appear to be an updated version of RubyGems?

  17. Myers Carpenter on 21 Nov 20:14:

    I wish for a 2.2.2 tag at github

  18. JD on 21 Nov 20:17:

    From the RubyGems post-update-to-1.3.1 message (which is a bit late if you’re having trouble upgrading):

    NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to follow the second set of update instructions if you see “Nothing to update”.

    NOTE: You may have to run the command twice if you have any previosly installed rubygems-update gems.

    If you have an older version of RubyGems installed, then you can still do it in two steps:

    $ gem install rubygems-update  (again, might need to be admin/root)
    $ update_rubygems              (... here too)
  19. DHH on 21 Nov 20:45:

    Myers, as you asked: http://github.com/rails/rails/tree/v2.2.2

  20. Dejan Dimic on 21 Nov 21:00:

    Congratulations on the release. Thanks everyone for all your work.

  21. Bob Martens on 21 Nov 21:05:

    Thanks to the entire Rails team and everyone who contributed to the process in any way. Exemplary work, and keep it up … really looking forward to Rails 2.3/3.0 and the finaly Ruby 1.9 release so that we can continue on into the future!

  22. Eric Cranston on 21 Nov 22:01:

    Awesome! I8n and thread safety are awesome improvements. I’m looking forward to 2.3/3.0 Hopefully I actually contribute to those!

  23. Mohamed Ashraf on 21 Nov 22:15:

    Great!

  24. schroedi on 21 Nov 22:15:

    Yes. i18n is very cool for our project. Now I am going to gem update—system !!

  25. AkitaOnRails on 21 Nov 22:52:

    Awesome stuff as usual. Congrats!

  26. WIN on 21 Nov 23:08:

    WIN!

  27. Josh on 21 Nov 23:10:

    very cool!

  28. Temujin on 21 Nov 23:15:

    Question. What is the big advantage with thread safety? Does this mean with Rails 2.2 that you don’t have to fire up X rails processes (each loading everything needed in their own memory space)? One of my biggest complaints with rails is that it hogs memory. On my server, 4 mongrel processes (yes, I know mogrel is soo 2006) takes ~400MB. What improvements over this (if any) should I expect by upgrading to Rails 2.2?

  29. DHH on 21 Nov 23:22:

    Temujin, if you’re looking to save on memory, your best bet is probably going to be Passenger + REE. They use copy-on-write memory management that can really cut down on memory usage when running many instances of the same app.

    The JRuby guys have similar advantages with using thread safety.

    Using thread safety with C Ruby isn’t going to give you that much yet. There are still too many things blocking to have a single process with 4 threads replace 4 processes without threads.

  30. Thiago Taranto on 21 Nov 23:23:

    Nice work guys!

    Update.now

  31. Radar on 21 Nov 23:27:

    I wrote a small rake task that can check for missing translations for your Rails 2.2 apps. Currently it doesn’t do interpolation properly, but that is the plan!

    http://frozenplague.net/?p=346

  32. Namcos on 21 Nov 23:32:

    Nice work on 1.9 compatibility!

  33. Tobias Weisserth on 21 Nov 23:56:

    Great job on the release. With i18n, Rails finally is an option! Thanks!!!

  34. Rafael on 22 Nov 00:10:

    Thank you. As always, I get very excited, not like for example watching Apples new products this year ;-)

    I am so looking forward and I will get even more excited with the next biiiig step: Ruby 1.9 and 2.3 / 3.x of Rails.

    Wish you a lot of phun and kick back for your work, ... for all of you!

    Thnx

  35. Alex on 22 Nov 00:23:

    Awesome. Rails is so awesome.

  36. Matthias Georgi on 22 Nov 00:37:

    About the blocking issue: isn’t it just the database driver and IO, which is blocking?

  37. Joe on 22 Nov 00:52:

    Great work! Now, has anyone firgured out how to successfully install Mongrel with Ruby 1.9.1 and Rails 2.2? I’m running into trouble with fastthread…

  38. Pedro Pimentel on 22 Nov 02:28:

    For me I18n was the missing default feature from rails to become really mainstream.

    Great work!

  39. Temo on 22 Nov 02:46:

    Thank you!

  40. Tris on 22 Nov 03:40:

    Thanks for the release. I ran into trouble with MySQL. I got a message saying to install the mysql gem manually, so I did. It installed ok, but my app couldn’t find it, even after restarting everything. I tried starting it again the next morning and it worked. I suppose I forgot to reset something.

  41. Andrew on 22 Nov 04:16:

    Thanks for all the hard work guys!

  42. Gustavo Scanferla on 22 Nov 05:44:

    When I started my recent project, it was on 2.0.2 You guys are too fast!

  43. NicholasH3ndra on 22 Nov 05:54:

    Yeehaaw…Great job guys! I am not patient to try this version.

  44. luonet on 22 Nov 05:56:

    太好了,祝贺祝贺

  45. Andrea on 22 Nov 10:01:

    great! Thanks guys!

  46. Rasmus on 22 Nov 10:44:

    Looking for to be using and learning from the new features. Thank you for your efforts!

  47. Patrick on 22 Nov 12:18:

    I’ve problem with MySQL. ”!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.” I’ve any idea. I’ve properly installed MySQL and Rails as mentioned on: http://danbenjamin.com/articles/2008/02/ruby-rails-leopard

    I work on Mac OS X 10.5.5.

    All my applications work properly in Rails 2.1

  48. karmi on 22 Nov 13:41:

    Be sure to update your Rails environment.rb in:

    RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION

    if you’re migrating from Rails bundled as submodule in vendor/rails…

  49. Nicholas on 22 Nov 13:57:

    On Mac OS X 10.5 (Leopard) I’m getting errors that Rails can’t find sqlite since upgrading to 2.2.2 (it was working fine under 2.1.2). I have been on rubygems 1.3.1, have sqlite3-ruby, etc all installed. The only thing that I changed this morning was to sudo gem update rails to 2.2. Any ideas why Rails can’t find sqlite now?

    MissingSourceFile (no such file to load—sqlite3)

    rails (2.2.2, 2.1.2, 2.0.2) rails-app-installer (0.2.0) sqlite3-ruby (1.2.4)

    which sqlite3 => /usr/bin/sqlite3

  50. Patrick on 22 Nov 14:19:

    I’ve resolved my problem with : ”!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.”

    The solution is here: http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard

    I’ve had the wrong version of mysql package – x86_64 is wrong. Should be x86 … so now everything is ok.

    Thanks guys!

  51. Rahsun McAfee on 22 Nov 14:34:

    Props go out to all contributors! The new additions are awesome and it’s great to see things continue to get better.

  52. Maxwell on 22 Nov 16:04:

    @Nicholas

    I’m seeing the same problems loading sqlite3 after performing the Rails upgrade. It doesn’t seem to be isolated to Rails though:

    $ gem list | grep sqlite3-ruby sqlite3-ruby (1.2.4) $ irb irb(main):001:0> require ‘rubygems’ => true irb(main):002:0> require ‘sqlite3’ LoadError: no such file to load—sqlite3 from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require’ from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require’ from (irb):2 irb(main):003:0>

    Could be related to my upgrade from gems 1.2.0 to 1.3.1 rather than the upgrade to Rails -- though the problem does have ramifications on my Rails testing environment.

    Anyone else? Link? Thanks!

  53. David on 22 Nov 16:33:

    Guys – thank you!

    I’m running into a problem with new projects. I get the message that Rails requires 1.3.1 but I have 1.2.0 installed. Gut $gem -v indicates I have 1.3.1 installed. I used your suggestion to: $ gem install rubygems-update $ update_rubygems

    and I follow up with

    $gem update—system.

    But to no avail!!

    I still get the error in Netbeans and the only way around is to use rails 2.1.0.

    Any suggestions?

  54. Attila Györffy on 22 Nov 16:35:

    got a problem with REE and Passenger right after I’ve updated to Rails 2.2.2.

    Now it seems like the package manager does not recognize Rails 2.2.2 to be installed.

    I’ve wrote a message and described the problem on the Google Groups page: http://groups.google.com/group/emm-ruby/browse_thread/thread/2ad5d826b8988fb0#

    I hope someone will know the solution to my problem. Thanks in advance,

    Attila

  55. Christopher Moura on 22 Nov 17:01:

    Thank you everyone! Rails 2.2 is great! I’ll check it out right now…

  56. Sam Schenkman-Moore on 22 Nov 17:03:

    @Nicholas, @Maxwell,

    I had the same problem, and while I doubt this is supposed to be necessary, this fixed it:

    config.gem ‘sqlite3-ruby’, :lib => ‘sqlite3’

    (in environment.rb)

  57. me on 22 Nov 18:04:

    congrats!

  58. Yee Tong Loh on 22 Nov 18:04:

    wow thanks sam! your solution worked perfectly. I wonder if its ok if i modify the gem files directly so that i wont have to do it to all my rails apps running on sqlite

  59. Nicholas on 22 Nov 18:35:

    do_sqlite3-0.9.7 —this gem is installed by Merb, and for some reason it doesn’t play well with Rails 2.2. I have removed it and I no longer get sqlite not found errors, but if I put it back the error returns. I tried Sam’s suggestion and it works too – now both Rails and Merb play in the same sandbox ok. Thanks for that tip!!

  60. Maxwell on 22 Nov 19:43:

    Thanks @SamSM and @Nicholas. I also found a link to a ticket in the Datamapper project re: problems with do_sqlite3 and sqlite3-ruby:

    http://wm.lighthouseapp.com/projects/4819/tickets/660-require-sqlite3-fails-with-do_sqlite3-097

  61. Rails Fanboy on 22 Nov 20:42:

    I am amazed at how quickly this community works!

    I seriously believe you guys are the fastest of all the development efforts, both open source and commercial, worldwide.

    Please, don’t sell out! When Amazon (or the myriad of other potential buyers) tries to finally buy you out, SAY NO!

    Apple, Adobe and Microsoft take note!

  62. Yaroslav on 22 Nov 21:19:

    I approve that do_sqlite3 gem removal brings things back to normal :-)

  63. Michael on 23 Nov 02:06:

    Thank you to everyone that contributed to the release!

  64. Sergio Bayona on 23 Nov 05:11:

    Congratulations to the Rails team and collaborators!

  65. Dan Croak on 23 Nov 05:34:

    Congratulations to all involved.

  66. URi on 23 Nov 18:13:

    Well done team!

  67. Wilco Niessen on 23 Nov 23:11:

    Excellent, thank you very, very much! Congratulations to the team!

  68. John on 24 Nov 02:07:

    Thanks!

  69. Joe on 24 Nov 02:35:

    Great!

  70. john on 24 Nov 03:37:

    @David

    gem install rubygems-update update_rubygems

    Should get you up and going.

  71. w on 24 Nov 04:47:

    :)

  72. w on 24 Nov 04:47:

    :)

  73. Aze on 24 Nov 08:22:

    Thanks!

  74. Andreas on 24 Nov 10:25:

    Just found this after working years with .net. Really amazing how fast you can develop on rails.

  75. Tszkan on 24 Nov 15:50:

    I have been long waiting for rails 2.2 especially i18n, I just hope our current app can be upgraded to rails 2.2 streamlessly. That is upmost wish feature for us (our chinese apps)

  76. Stijnster on 24 Nov 16:06:

    Thanks guys!

  77. Granit Arbeitsplatten on 24 Nov 22:14:

    congrats to you all! thanks for all your work.

  78. Dave on 25 Nov 03:47:

    I can’t install Rails 2.2.2 on one of my servers. With Rails 2.1 installed, gem update gets rails 2.1 again. Running:

    gem install rails -v2.2.2

    And I still get rails 2.1.0.

    Been Googling around for a while, but I haven’t found what the problem might be.

    gem sources => http://gems.github.com/ http://gems.rubyforge.org

    Any ideas?

  79. jmfaber@supersaas.com on 25 Nov 12:13:

    I found the weirdest bug. In 2.2.2 erb will no longer interpret the first line of your template if it starts with ’%’. I start all my templates with % @title=’...’ so to upgrade I will have to add a newline to all template files in all my projects :-(

  80. Balázs Vida on 25 Nov 12:48:

    Great job, guys!

  81. sigma on 25 Nov 13:00:

    I got huge problem with mysql connetion! I can’t install mysql gem under vista! Always an error like “C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so” apears… Anyone an idea??

  82. Branden on 25 Nov 15:34:

    In case any of your are having sqlite3 1.2.4 issues try reverting to version 1.2.3. I was having problems with 1.2.4.

    I guess sqlite3 1.2.4 lacks win32 support from what I read on a blog. I kept getting a nmake errors after I upgraded all my gems and it was pissing me off and took me like an hour or two to find someone who experienced the same thing.

  83. Yee Tong Loh on 25 Nov 15:51:

    a new version of do_sqlite3 (0.9.8) seems to have fixed the problem. now it is working fine..

  84. Michael on 26 Nov 10:37:

    Could it be that a freshly generated app is missing “scriptaculous.js”?

  85. Nathan Zook on 26 Nov 19:41:

    On updating rubygem: I have NEVER been able to get gem upgrade—system to work on versions prior to 1.3.0. If your version is earlier, you may well need to grab the tarball from sourceforge, unzip, untar, and run the install script.

  86. Peter Boling on 27 Nov 05:20:

    I had rails 2.2.2 installed before this rails 2.2 was released. I thought 2.2.2 was a RC (Release Candidate)

    So now when I install rails it does nothing.

    If I uninstall all rails 2.2.x and reinstall it only replaces the rails gem not any of the supporting cast (Active* and Action*).

    So if you installed 2.2.2 before 2.2 was released is there a special upgrade path?

    So is 2.2 really 2.2.2?

    Why didn’t you bump the version number from the RC so it would be a clean install, and give us peace of mind?

    Color me confused.

  87. Jason Arora on 27 Nov 06:14:

    If you are having problems with MySQL, getting errors like: “The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.” “C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so”

    Here is the solution: 1) First, gem install mysql. If this doesn’t help continue… 2) Copy libmysql.dll from InstantRails (see below) to your mysql directory (C:\mysql\bin\). Restart your computer and it should be working.

    InstantRails libmysql.dll: http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/

    Hope this helps…

  88. Charles Forcey on 27 Nov 10:06:

    On Nov 22, David asked about a problem in Netbeans with the old GEM version showing up. You probably solved it, but I went to Platform Manager, created a new platform, and picked my /usr/local/bin/ruby interpreter. Once I did that, the new GEM 1.3.1 and all my updated gems showed up in the Netbeans Gem Manager. Good luck, Charles

  89. Margareth on 27 Nov 18:01:

    I update my gem and my rails version but when i run script/server appears the following error: ... `report_activate_error’: Could not find RubyGem rack (~> 0.4.0) (Gem::LoadError) ....

    What i have to do??

  90. Pawel on 28 Nov 09:07:

    Margaret I had the same problem, i used rails gem:freeze and my rails version was showing 2.3.0… i just remove frozen rails and used system 2.2.2 and it works fine.

    hope that helps..

  91. Daniel Farrell on 29 Nov 02:26:

    For updating NetBeans 6.5 to the latest gem run the following:

    cd /Applications/NetBeans/NetBeans\ 6.5.app/Contents/Resources/NetBeans/ruby2/jruby-1.1.4/ bin/jruby -S gem install rubygems-update bin/jruby -S update_rubygems

  92. sameera on 29 Nov 14:48:

    Thanks Guys… I already installed it…. waiting to startoff ;)

  93. Andrew on 29 Nov 22:03:

    Is anyone else getting associations not found on the second hit? It works the first time, then breaks the second time.

  94. Lailson Bandeira on 29 Nov 23:57:

    rails really look awesome, great work guys. hey, can you tell me what textmate theme are you using on new weblog demo? i thought it very beautiful.. thanks

  95. Cice on 01 Dec 08:08:

    is there a way to get the FormBuilder.label helper to translate my model attributes?

(leave url/email »)