Ruby 1.8.7 compatibility

Hi folks!

Getting started guide say Rails 3.1 is compatbilbe with ruby 1.8.7 or higher, but Rails 3.1 is plenty of hash declarations in Ruby 1.9.2 way

Blog::Application.config.session_store :cookie_store, key: ‘_rails31_blog_session’


<%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %>


AFAIK Rails 3.2 will be compatible just with Ruby 1.9.2 but Rails 3.1 is still Ruby 1.8.7 compatible. isn’t it?

Ruby 1.8 compatibility won’t be dropped until Rails 4.x. Rails will generate your application using Ruby 1.9 hash (and, I believe, lambda) syntax if you create it using Ruby 1.9 (the same is true for generators). If you want to run your application on Ruby 1.8, I would suggest developing primarily using 1.8.

Ben Langfeld

OK I see, this is a very important point to mention in Rails guides in a big alert box. I like magic, but just when I know the trick.


In Rails 3.1, you can force the 1.8 hash syntax with

$ rails -v

Rails 3.1.0

$ rails -h | grep 1.9

[–old-style-hash] # Force using old style hash (:foo => ‘bar’) on Ruby >= 1.9