Simple Question: Is Rails 2.3.4 backward compatible with Rails 2.3.2? - ruby-on-rails

A client is indicating that the Rails version I have installed on my Ubuntu servers (2.3.4) is not backward-compatible with the older Version 2.3.2.
I want to know if that is true or not before I attempt to install the older Rails.

the beauty of rubygems. just install both versions and have them specify which version in their environment file problem solved who cares if its compatible or not

New features are never backward compatible.

Well, it is possible that you are using features that are only available on version 2.3.4 , and therefore they're not on version 2.3.2.
Check its changelog to see the differences.

Upgrading between even minor Rails versions often causes problems with old apps.
That said, 2.3.4 is the current recommended stable version so it would probably be worth biting the bullet and getting the 2.3.2 app running on it. Probably won't take very long, if you've got a decent test suite.

There are also a few of bugs that are introduced. Like this one I found involving named scopes using includes. That was introduced in 2.3.3 and wasn't fixed in 2.3.4

2.3.2 => 2.3.4 has been the most painless upgrade so far for us (large app with lots of legacy, rails 1.x code).
The only major issues we had were with after_initialize vs exists?.
It all varies app by app. If you are hosting a client's app, then you should provide gems of all rails versions (they will happily sit side by side (90% of the time)).

Related

Why upgrade an application to latest version of Rails?

I'm just trying to understand the factors that are considered to decide that an application written in a lower version needs to be upgraded.
I would like to think it comes down to these factors:
The Rails team is pretty active and they remedy Rails core security issues as soon as they come across one. It would be nice to have your Rails version always updated which means your have all the security issues of the past addressed as well as open to further updates if they come along. You would not want an older version of Rails get in the way of a security update.
There are always performance improvements in almost every new version of Rails and optimization is an area to work in for Rails apps. You should take advantage of them by keeping your Rails version updated.
Its not only the Rails version, the underlying Ruby version also receives updates and performance improvements. The updated version of Rails makes use of these.
There is also the gem dependency issue. Gems also receive updates and security patches and at times, newer versions of these gems are not compatible with an older version of Rails.
It is easier to upgrade a Rails application to its next version than to its next|next|next|next version. Blog posts and migration guides are always online but if you are coming from a very very old Rails version, they will become very hard to follow.
Newer versions of Rails provide functionality that is not available in the older versions of Rails. It is always nice to have this functionality at your disposal. You never know you may need it in your project.

Suggestions required to convert ruby 1.8.x to 4.1 version

I have developed application on rails 1.8.7 three years back. Now i would like to convert it to latest version of rails.
Can you suggest steps to convert to latest version ?
As Pavan already said, you probably mean Rails 4.1. Was your application developed with Rails 3.2? If so, check out this upgrade guide: http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0 You should upgrade from 3.2 to 4.0 first and then use the advantages of 4.1.
Of course, a decent test coverage helps you to reduce time spent on debugging and error finding.
Also you need to upgrade your Ruby version to at least 1.9.2 (2.1.0 is better). This should not introduce any errors to your code.
edit:
If you are absolutely sure you have Rails 1.2.5, it will actually be too old to upgrade it. You need to upgrade it to every major version and see if everything is stable. I assume the effort to reimplement it in Rails 4 directly is not much larger.

which version of rails should I use for a new project

I have been working with rails 2.3.5. I am gonna start a new project on rails. Should i continue using the earlier version or should i hop on to rails > 3 ? If so which is the more stable version?
It is better to use rails 3.0.x version as these days lot of new plugins(like active_reload) are targeted only for 3.x version.
3.1.x have lot of cool features(like asset pipeline, saas integration, coffescript integration, etc), but its still a release candidate and I faced some issues while using it. I guess we have to wait for the stable 3.1.x release.
I have been using 3.0.7 for a while and found it to be very stable.
3.0.10 is recently released and you can easily upgrade to it from 3.0.7 any time you want in the future.
If you are stuck to 2.x version you will be missing cool features like mentioned here: http://net.tutsplus.com/tutorials/ruby/5-awesome-new-rails-3-features/
For a new project, I would use Rails 3.1 or for a bit more stability, 3.0.7. There are some noticeable differences compared to 2.3, but it will be supported for longer and most development of new gems and documentation are being written for Rails 3.
You should definitely NOT use 2.3 and earlier.
The Rails framework is improving at a steady pace and if there is a downside to that is that it can be a pain to upgrade from version to version, especially as regards to major version changes which introduce tons of backward incompatibilities.
Why then would you want to put yourself in the hole at the get go.
Another issue is how ready and mature is the ecosystem (ruby, popular gem packages, etc.). This leads you to consider whether you should start with 3.0.10 or 3.1 release candidate.
It turns out the great majority of gems working with Rails 3.0 is also working fine with Rails 3.1.
The little downside is that 3.1 is still in release candidate status but it's all but ready for final release and that should come within a matter of days or maximum a couple weeks (as of today Aug. 25, '11).
I would strongly recommend you start all new apps with 3.1. That's what I'm doing.

Why are there different Ruby On Rails versions?

Disclaimer : I am totally new to Ruby on Rails but planning learning it.
This morning I have been reading there were two new Ruby On Rails releases (2.3.11 and 3.0.4).
I don't understand why people (the ROR community) are working (maintaining) different versions ? What are the benefits for developpers ?
Active development is not being done on the 2.x branch. However, there are lots and lots and lots of deployed 2.x applications in the wild, and given that yesterday's releases were security-related patches, they provided a patch for 2.x users.
Upgrading a Rails application from 2.x to 3.x is not necessarily easy or trivial, and it's unreasonable to expect that as a solution to a security hole, so the 2.3.11 release was made instead.
The benefit is for people who are still using the old version and for some reason does not want to or cannot upgrade to a newer version. It is standard practice that there is some maintenance of old versions.

Ruby 1.8 vs 1.9 market share for Rails Apps

Anyone seen any tangible metrics or sites that talk about the percentages of Rails apps in production that are using Ruby 1.8 vs Ruby 1.9?
In other words, we're contemplating back support for 1.8 but want to know if it's really worth it.
Thanks!
Chad
If you already have a 1.8 application that is running fine then there may be reasons to wait before switching (Plugin incompatibility mainly).
If the application is already written in 1.9 then don't bother. 1.9 is such a large improvement (particularly in regards to performance) over 1.8 that there's no sense in building a 1.8 application. Any webhosts that do not yet support 1.9 are definitely going to support it soon since I can't think of anyone building a new application in 1.8 but I can think of half a dozen people building new apps on 1.9.
There are enough differences between the two that maintaining compatibility for both would be a chore for large applications. In particular, you would need to run your unit and functional tests twice (once for each platform).
We can't know how much site use Ruby 1.9. But the railsplugins website try to say if plugin is or not compatible with Ruby 1.9
There a really less hosting service with Ruby 1.9 compatibility. Heroku try to be compatible in beta and EY try too. But it's not compatible :(
NewRelic occasionally release a "State of the Stack" report, showing who's using what version of Ruby in production, along with other Rails usage metrics. The latest can be found at http://blog.newrelic.com/2011/09/28/state-of-the-stack-a-ruby-on-rails-benchmarking-report-sept-2011/

Resources