gorlaz
gorlaz

Reputation: 478

Practical differences between Rails 2.3.14 and 3/3.2?

I'm just starting Rails dev by using Michael Hartl's walkthrough and have hit a snag.

My shared hosting that I'm using uses CPanel which has a bug where it can't work with Rails 3. There is supposed to be an update (CPanel 11.34) coming out within the next 6 months that is supposed to fix this.

The version my host uses is Rails 2.3.14.

Obviously there is going to be a world of difference between 2.3.14 and 3/3.2

I'm in Australia which doesn't have an equivalent to Heroku or EngineYard and I need Australian hosting as the data my app will consume/output needs to stay in Australia.

First question is can someone point me at the right direction re limiting my dev environment to the same version as my host? I'm not concerned with multiple versions using rvm. Is it just the freeze command?

Second question is what are the downfalls in developing for the old version? Obviously I'll need to migrate when 3.0 is available on the webhost. Are there any features/specifics that are showstoppers in terms of developing for 2.3.14?

Any help much appreciated

Upvotes: 2

Views: 1483

Answers (2)

Frederick Cheung
Frederick Cheung

Reputation: 84134

You can still use bundler with 2.3 - this makes it easy to restrict yourself to specific versions of gems, including rails itself.

I can't think of much that you can't do with 2.3.x, obviously people were writing web apps quite happily back then too. There are a lot of new things in the 3.x series: the asset pipeline, mountable engines, easier to use different ORM or javascript libraries, new routing api, new arel based active record etc. There are a lot of internal changes too that make it easier for 3rd parties to write gems that extend rails or provide slices of functionality like authentication.

Not so much a change, but a significant fact of 2.3 versus 3.x is that 2.3 is falling out of usage: people writing helpful gems (carrierwave, devise, factory girl etc) or tutorials are frequently targeting 3.x only or no longer maintaining their 2.x versions.

Upvotes: 2

Rich Drummond
Rich Drummond

Reputation: 3519

Second question is what are the downfalls in developing for the old version?

For one thing you will have to be careful to not use features of ActiveRecord that are not available in 2.3.x. For example, in 3.x you can do things like this:

 Client.where("orders_count = ?", params[:orders])

But in 2.3.x you would have to do:

 Client.first(:conditions => ["orders_count = ?", params[:orders]])

In 2.3.x, you cannot chain query methods to build up a query, either.

Upvotes: 0

Related Questions