Home > Enterprise >  Can I use Ruby 2.4 code in Ruby 3 without getting any error?
Can I use Ruby 2.4 code in Ruby 3 without getting any error?

Time:10-19

I was wondering if I could use codes based on ruby 2.4 in ruby 3. I want to download ruby 3, but use codes based on ruby 2.4. Can I do that? I know that Ruby tries to be backwards compatible, but I would like to know if it is this backwards compatible.

CodePudding user response:

The short answer is pretty No.

You will have as many compatibility issues as many legacy code you have.

Try to reach some resources like https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html

But still, If you have well-written tests, they will fail, and deprecation warnings will occur. Those will be some kind of map for you(by fixing issues) to reach a new version.

  • Related