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.
Related
I need to develop a rails app. I am confused on which version should I use for develop 4.2 or 3.2.
If I develop on Rails 4.2 will it be compatible with Rails 3 or higher version because we are developing the app as a product.
I don't understand well your issue. Are you developing from scratch? Then you should use the last stable version (4.2) because you will have support for a longer time. Anything that you code and test will work.
Version problems come when you already have some code and want to update your Rails version while keeping old code, example: You have an old Rails 3 app and for some reason you want to migrate it to Rails 4.
Even then, if you have different existing rails apps in your server, you can use RVM to have them all living at the same time.
It seems there are some concepts missing here: The main problem you have is with your Gemfile and probably some of the new syntax introduced in Rails 4. You just shouldn't be moving code between Rails app which have different versions, that's all.
Recently I have been tasked with working on a fairly high volume Rails api (5k requests a second at peak).
Prior to this I've spent most of my coding efforts on Java applications, I'm just new to the world of Ruby/Rails.
At home I've been using the latest versions of Ruby/Rails to develop some small applications and get a feel for the language and framework.
The Rails application at work is built on Ruby 1.8.7 and Rails 2.3.16 and to me it seems quite old and there are quite a few syntax and new features missing compared with the current versions I use at home. I prefer the newer versions of ruby and rails.
I raised with my team about wanting to upgrade to newer/latest versions but I was told that newer versions of Ruby aren't 'production' ready. Sadly due to my inexperience with Ruby I'm not really in a position to dispute this.
Any good articles/metrics showing either same or better performance with newer Ruby/Rails versions? Personally I would expect newer iterations of a language/framework to have better performance.
What your team probably meant instead was this:
My Linux distribution of choice still ships Ruby 1.8.7 (or 1.8.6 if you are unlucky). As they haven't updated yet, I think it's not stable yet, but I have no hard data on this.
However, Linux distributions are very slow to change and it's rather hard for them to ensure that all software was updated to properly work on newer language versions.
That said, Ruby 1.8 is nearing end-of-life rather fast. Right now, it only receives security updates anymore but no other bug fixes. In July 2013 it will be completely unsupported. This alone should be enough reason to upgrade your app rather soon.
As for the performance question: Ruby 1.9.3 is considered faster than Ruby 1.8.7 for most workloads. Ruby 2.0 is considered a bit faster than 1.9.3 but less so than the change from 1.8.7 to 1.9. That said, general performance advices are hard. You should check for yourself if these statements are true for your app.
These could help you
http://nerds.airbnb.com/upgrading-from-ree-187-to-ruby-193
http://blog.pothoven.net/2012/10/ruby-187-vs-193-performance.html
http://pulse.sportngin.com/news_article/show/156863?referrer_id=543230
note that ruby 2 has even better performance
It's not quite clear what you are asking. You start off about perfomance, then you switch to "production-ready", then back to performance. Since you asked about performance twice, I'll assume that's what you meant.
The Ruby version makes no difference on the performance. Some people claim otherwise, but there haven't been any benchmarks actually demonstrating any sort of impact of the Ruby version on performance.
What does have a great impact on performance is the Ruby implementation you are using and the version of the implementation, as well as the environment that you are running it in. For example, JRuby is faster than MRI, JRuby 1.7 is faster than JRuby 1.6, JRuby 1.7 running on HotSpot is faster than JRuby 1.7 running on J9, JRuby 1.7 running on HotSpot 1.7 is faster than JRuby 1.7 running on HotSpot 1.6, JRuby 1.7 running on HotSpot 1.7 with the C2 compiler is faster than JRuby 1.7 running on HotSpot 1.7 with the C1 compiler, and so on.
Support for Ruby 1.8.7 will be dropped completely after June 2013 as per this.
So it's better to upgrade to Ruby 1.9+ and Rails 3+. Checkout this awesome post about how to migrate from Rails 2 to Rails 3+
It is older for current releases of Rails, but as you have Rails 2 app, this post will help you finding differences between Rails 2 and Rails 3+ apps.
Also checkout Railscasts for awesome screencasts about how to upgrade to Rails 3, changes introduced in Rails 3 and Rails 4
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.
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/
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)).