Ruby 3.2 + Rails 6.0.2 activesupport error - ruby-on-rails

I`m trying to create a new Rails app, using Ruby v 3.2.0 and Rails 6.0.2, but I get following error. Anyone know how to solve this problem?
Error image

Ruby on Rails 6.0 was released before Ruby 3.2 existed. Therefore, it is not surprising that Ruby on Rails 6.0 does not support running with Ruby 3.2
According to the answers to this question, Ruby on Rails 6.0 should run well on Ruby 2.5–2.7.
I suggest downgrading your Ruby version to the latest 2.7.x version: 2.7.7 was released about two months ago.
But keep in mind that Ruby 2.7 will reach end of life in about two months. Therefore, you might want to consider updating your application to 6.2 or 7.0 soon.

Related

looking for recommended upgrade path for app (ruby 2.3.8 , rails 4.2.11) to the latest stable versions of ruby and rails

as the title states, I'm looking for a recommended path for app (ruby 2.3.8 , rails 4.2.11) to the latest stable versions of ruby and rails, that is the safest, most stable option for a very, very large codebase.
e.g.
is it better to first upgrade ruby to 2.4 , then 2.5 and so on, and then come back around to upgrading rails in small steps (e.g. 4.2 => 5.0.x => 5.1.x => ...) ?
what ruby version is the latest version that can be used to run rails 4.2.x ?
any recommendations / guidance would be greatly appreciated.
The first step is to make sure that your application has enough tests to give you confidence during upgrading the application.
Then you can start the actual upgrade process. There are different ways to do this. I usually suggest updating in smaller steps, instead of huge all in once upgrades, because that makes it much easier to fix issues along the way because you know exactly with Ruby or Ruby on Rails version introduced the issue.
Additionally, each Ruby on Rails version has a range of Ruby versions they are compatible with, and you have to update them in matching combinations.
Some people propose that you should upgrade to the lowest minor and patch version first and then to the latest minor, for example, like 5.0.7.2 -> 5.1.0 -> 5.1.7. But in my experience, it is fine to update directly to the latest version of the next minor version, like 5.0.7.2 -> 5.1.7.
I recommend following this table with Ruby and Ruby on Rails compabilities. This leads to the following upgrade path:
ruby 2.3.8 rails 4.2.11 your current versions
|
ruby 2.3.8 rails 4.2.11.3
|
ruby 2.3.8 rails 5.0.7.2
|
ruby 2.4.10 rails 5.0.7.2
|
ruby 2.4.10 rails 5.1.7
|
ruby 2.5.9 rails 5.1.7
|
ruby 2.5.9 rails 5.2.8.1
|
ruby 2.6.10 rails 5.2.8.1
|
ruby 2.6.10 rails 6.0.6
|
ruby 2.6.10 rails 6.1.7
|
ruby 2.7.7 rails 6.1.7 minimum combination to still get security fixes
|
ruby 3.0.5 rails 6.1.7
|
ruby 3.0.5 rails 7.0.4 minimum combination to still get bug fixes
|
ruby 3.1.3 rails 7.0.4
|
ruby 3.2.0RC rails 7.0.4
Note that at the time of writing this answer (summer 2022) Ruby 2.7 and Ruby on Rails 6.1.x still get security fixes. Therefore, I would suggest that to be the lowest version combination to run on production. Bug fixes are only available for Ruby 3.0 and Ruby on Rails 7.0.x and above.
During each step, consult Upgrading Ruby on Rails in the official Rails Guides about what changed in that specific version. After each step, make sure to fix all deprecation warnings that might occur.
Please keep in mind reviewing all your other gems too. I would consider it a good practice to update all gems to the latest versions that are compatible with your current Ruby and Ruby on Rails combination after each step and before making the next upgrade step.

Is Rails version 3.1.1 compatible with Ruby version 2.3?

I am in a situation where I need to update several API-connected gems that are no longer supported by my current version of Ruby. (1.9.3) The Rails release notes for Rails version 3.1.1 state that Rails 3.1 requires Ruby 1.8.7 or higher but it's hard to tell if that includes versions of Ruby which might have been updated more recently than the release notes.
Am I good to update to 2.3 on my Rails 3.1.1 app?
Form the release notes of Ruby on Rails 3.2.13:
There is one big thing that is technically a fix but is sort of a feature: Ruby 2.0 support. Big thanks to Prem Sichanugrist for putting that together! Please give your applications a try on Ruby 2.0 and let me know how that goes.
That said: When Rails 3.2.13 was the first version of Rails with Ruby 2.0 support then it is unlikely that the older Rails 3.1.1 version is working with Ruby 2.3.

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.

When using Rails 3.2.22.2, what is the highest Ruby Version I can use?

I'm looking to upgrade a large application with many gems. It's currently on Ruby 1.9.3p551.
I've heard that I can upgrade to Ruby 2.2 but not any higher.
Is this version of Rails compatible with Ruby 2.2.5, alternatively, how can I find out the highest possible version supported.
Quote from this blog post
Rails 3.2.22 includes all the commits from the 3-2-stable branch. This mean that now Rails 3.2 supports Ruby 2.2.
Since Rails 3.2 doesn't receive bug fixes anymore (only severe security fixes) I would not expect updates to the Rails 3.2 branch that ensure Ruby 2.3 compatibility. Furthermore Rails 3.2 reaches end of life when Rails 5.0 is released (what will be very soon, since 5.0.0.RC1 is already available).

Can I update to Ruby 2.1.2 using Rails 3.2.3?

First of all, I think it isn't a prohibited question on StackOverflow since it's a precise question about environment, an objective question. But if it's prohibited, please tell me.
Currently I'm developing a specific project that is using Ruby 1.9.3 and Rails 3.2.3, at the moment we can't upgrade to Rails 4 because the project dependencies.
My question is:
Using Rails 3.2.3, we can upgrade to a newest Ruby version? If so, what version: Ruby 2.0, Ruby 2.1.2 or another one?
Also, I searched on Google and StackOverflow and I don't find a question like that.
Thanks!
The first release of rails that officially support ruby 2.0 was 3.2.13 (see the announcement on the rails blog.
I deployed several applications running 3.2.15-3.2.17 and ruby 2.0 (They've since been upgraded to rails 4) without any problems that I recall.
The recently released 3.2.22 supports ruby 2.2 (announcement)
According to the Travis configuration, Rails 3.2.3 was only tested with Ruby 1.8.7, 1.9.2 and 1.9.3, so it doesn't seem to be a good idea to use a later version of Ruby (but you can always test it yourself.) However, Rails 3.2.3 has some known security vulnerabilities that have been patched in 3.2.19.
On the other hand, the configuration for Rails 3.2.19 does suggest that the developers expect it to work with Ruby 2.0.0. Your project might benefit from investing some effort to see if you can upgrade from Rails 3.2.3 to 3.2.19, and test a combination of that with Ruby 2.0 for your application, if there are new Ruby features that you need and cannot efficiently backport them. Bear in mind that the only recent answer to a similar question warns of 'weird issues' from such a combination. Also consider that the latest Rails 3.2 release notes do not mention Ruby 2.0.

Resources