Should I use Ruby 1.9.2 for my Rails 2.3.10 application?

I have an existing Rails 2.3.10 application that I am considering when upgrading to Ruby 1.9.2 from version 1.8.7. Before I start hacking into an application, trying to make it work, I try to decide whether it’s even worth the effort.

To understand how much work can be involved, I just run all the specifications (rspec 1.3.1) in Ruby 1.9.2. 98% of the tests pass, but they work about 3 times slower, and there are a ton of messages such as "Ruby 1.9 does not yet support Unicode normalization." I found a message about this problem , so I know that I can fix it, but I am concerned about the speed and other problems that I may have encountered.

My other option is to upgrade the application to Rails 3 and go to 1.9.2 at that time. This seems like a much better solution in the long run, but there could potentially be a lot more work.

tl; dr - should I upgrade to 1.9.2 now or wait for Rails 3 to turn on the application?

+4
source share
1 answer

I would recommend doing both, but the order in which you do them, or if you do them at the same time, is really a personal preference. If you have a strong test program with good coverage, this is a great first step in the transition process. The main road blocks you will encounter are as follows:

  • Many new gem versions only support Rails 3, so if you only take one step at a time, make sure you support gems. For example, you don’t want to get stuck in a situation where the gem needs updating, because you are using Ruby 1.9.2, but the new version of the gem is only available in Rails 3.
  • There are some syntax changes in Ruby 1.9.2, and compiled C extensions need to be rerun or reinstall gems.
  • There are significant changes to the application configuration from Rails 2.3 to Rails 3.0. They take some time, but there is a lot of support.

In general, Ruby 1.9.2 will be faster than Ruby 1.8.7, and will provide some cool new syntax. If you get the opposite results, I would check your code and make sure that it is in fact, and that these are not just unsuccessful tests that slow down your package.

+3
source

Source: https://habr.com/ru/post/1338569/


All Articles