how to convert Ruby application 1.8.7 to 1.9.2 - ruby-on-rails

hi I have one application in ruby but in that application developed in ruby 1.8.7, now I am using ruby 1.9.2 any possibility to change my application 1.8.2 to 1.9.2 or 1.9.3

Hope this tutorial is helpful to start working on upgrading your application to Ruby-1.9.3
He explained nicely how to upgrade from Ruby-1.8.7 to Ruby-1.9.3

Given that your rails app is using day-to-day ruby functions, upgrading to ruby 1.9 should not be an issue, however read this major changes note, from ruby 1.8 to 1.9.x and see if you are using any methods that are mentioned there. But practically in most cases your rails app should run without any modifications.
And when you are installing ruby1.9.x use RVM (Ruby Version Manager) , to have your both ruby 1.8.7 and 1.9 versions side-by-side.
and if you have a good test suite, this should not be a problem at all :)
best of luck

Related

What is the highest Ruby version supported by Rails v4.1.16?

In other words, can I run Rails 4.1.16 on Ruby 2.4? If not, can I run it on Ruby 2.3?
Based on the CI settings for 4-1-stable, I'd say stick with Ruby 2.3. 2.4.0 isn't on that list, as things stand.
That's not to say that 4.1.16 won't run on Ruby 2.4 - I can't really speak to that - but there's always a possibility that you hit subtle issues, depending on the features you use and the gems that you include. Ruby 2.4 has the Fixnum and Bignum unification, as well as unicode changes - which potentially could have an impact.
FWIW, we have a sizeable, battle-tested application on the 4.1.x branch that works just fine on Ruby 2.3.3.
seems 2.4 should work with rails 4.x
Rails generally stays close to the latest released Ruby version when
it's released:
....
Rails 4 prefers Ruby 2.0 and requires 1.9.3 or newer.
...
http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#ruby-versions
According to Rubygems, Rails 4.1.16 should work with any ruby version higher or equal to 1.9.3. I would recommend testing it extensively in a local environment so you can check for any possible deprecations.
Also, in case you are not, consider using RVM or any other Ruby version manager.
The Rails blog posted recently that the first version of the 4.2 series that officially support Ruby 2.4 is Rails 4.2.8.

should I be using 1.9.2 or 1.8.7 for rails 3.0 production apps?

I'm currently using 1.9.2 with rails 3, and I ran into a snag with ruby-debug.
Should I be using 1.8.7 to be more on the safe side with rails 3?
I'm new to rails, and I want to stay away from hackish workarounds or configuration nightmares.
(I'm using rvm)
The best in performance is ruby 1.9.2. But ruby 1.8.7 is stable too. So you can use both.

Rails app w/ 2.2.0 embedd how to use ruby 1.8 vice 1.9

I have just downloaded an app that is based on Rail 2.2.0 which is included in the app. I have just upgraded to Ruby 1.9 and I still have Ruby 1.8 on my machine. Is there a way I can tell this app to use Ruby 1.8 vice 1.9? Would it be easier to decouple the app from Rails 2.2.0 and upgrade it to Rails 2.3.6? If changing the rails would be easier, how do I do that?
You could use RVM (Ruby Version Manager) which is a command line tool which allows you to easily install, manage and work with multiple ruby environments from interpreters to sets of gems.
That way you can have a different set of gems (including Rails) under Ruby 1.8 and a different set of gems under Ruby 1.9.

Is it possible to run Ruby on Rails with Ruby 1.9x?

If so, how?
When you go to http://rubyonrails.org/download, it says:
We recommend Ruby 1.8.7 for use with
Rails. Ruby 1.8.6, 1.8.5, 1.8.4 and
1.8.2 are still usable too, but version 1.8.3 is not.
Rails does work in 1.9 as of 2.3. I suppose they still recommend Ruby 1.8.7 because it has the most compatibility with other Ruby libraries — a lot of them are still catching up.
From the announcement of Rails 2.2:
Jeremy Kemper has been rocking on both Ruby 1.9 and JRuby compatibility. Rails 2.2 is fully compatible with both, but again, there might be supporting libraries and gems that are not. Again, lots of work is going into making everything else fully compatible as well.
Then, from the release notes for Rails 2.3:
Rails 2.3 should pass all of its own tests whether you are running on Ruby 1.8 or the now-released Ruby 1.9.1. You should be aware, though, that moving to 1.9.1 entails checking all of the data adapters, plugins, and other code that you depend on for Ruby 1.9.1 compatibility, as well as Rails core.
Based on their discussion board, Rails 2.3.0RC1 and later versions are compatible with Ruby 1.9.1 (and presumably, any later 1.9 versions). I'm guessing they haven't gotten aroudn to updating the site properly.
Rspec has only recently been ported to 1.9, therefore many gems have not been able to run their test suites in 1.9 until recently, so many gems are not yet stable in 1.9

Anyone Try Running Rails 2.2 (or Edge) under Ruby 1.9.1 RC1

Ruby 1.9.1 RC1 was released today so I quickly moved to install it (a test version of course using a suffix of 19). I install Rails and Rack for the 1.9 RubyGems and then create a new Rails site using edge... when I execute:
ruby19 ./script/server
I watch as the processor usage goes up to 99.8 and the terminal just sits there. Trying to run Rails 2.2 using 1.9.1RC1 gives all sorts of fail on the inflector. I was under the impression that Rails 2.2 was 1.9.1 compatible. Is anyone successfully testing Rails under Ruby 1.9.1 or are you seeing similar errors?
The same thing for me.
I'm running the latest edge rails under webrik and just see the blank screen and no response to Ctrl-C. Rails 2.2 isn't working at all.
Also, I've tried run edge under thin (with eventmachine from github fixed to build on ruby 1.9.1, except one broken ruby test - I've just added empty one with 'assert true').
After that, both webrick and thin crashes immediately with:
$ /usr/local/bin/ruby script/server
/usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.3/lib/rubyeventmachine.bundle: [BUG] Bus Error
ruby 1.9.1 (2008-12-30 patchlevel-0 revision 21203) [i386-darwin9.6.0]
So, I guess, we all need calm down now. There still much work to actually run our rails apps under 1.9.1. Many gems are still at the early stages of bringing compatibility with 1.9.1
Actually, rails 2.2 is not fully compatible with ruby 1.9.1, just a basic compatibility, according to rails core team :)
Full compatibility claimed in upcoming rails 2.3.
I have written a guide on using Rails edge (near enough to 2.3) and Ruby 1.9.1. mysql, postgres and a few other gems like hpricot, thin and mongrel don't work, but the application does work.
Rails 2.2.2 is not compatible with Ruby 1.9.1rc1 when processing characters and strings on ActiveSupport. Rails uses multibyte to support unicode char-set, in other hand Ruby 1.9.1 uses built-in unicode support. Supported versions is 1.8.5 to 1.8.7.

Resources