Feature #36205

Ruby 3.1 support

Added by Pavel Rosický about 1 year ago. Updated 9 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Ruby support
Target version:5.0.0
Resolution:Fixed

Description

net/* libraries were gemified, see https://bugs.ruby-lang.org/issues/5481

diff --git a/Gemfile b/Gemfile
index 949fe86d2..624d40216 100644
--- a/Gemfile
+++ b/Gemfile
@@ -26,6 +26,12 @@ gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]
 gem 'rotp'
 gem 'rqrcode'

+unless Gem.ruby_version < Gem::Version.new('3.1.0')
+  gem 'net-smtp', '~> 0.3.0'
+  gem 'net-imap', '~> 0.2.2'
+  gem 'net-pop', '~> 0.1.1'
+end
+
 # Optional gem for LDAP authentication
 group :ldap do
   gem 'net-ldap', '~> 0.17.0'

36205-v2.patch Magnifier (1.75 KB) Go MAEDA, 2021-11-20 10:00


Related issues

Related to Redmine - Defect #36226: Psych 4: Psych::DisallowedClass exception when unseriali... Closed
Related to Redmine - Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias ex... Closed
Related to Redmine - Defect #36360: IssuesSystemTest fails with ArgumentError in Ruby 3.1 Closed
Blocked by Redmine - Patch #35025: Update capybara to 3.36 Closed

Associated revisions

Revision 21296
Added by Go MAEDA about 1 year ago

Ruby 3.1: net-smtp, net-imap, and net-pop are now bundled gems (#36205).

Contributed by Pavel Rosický.

Revision 21328
Added by Go MAEDA 12 months ago

IssuesSystemTest fails with ArgumentError in Ruby 3.1 (#36205, #36360).

Patch by Yuichi HARADA.

Revision 21329
Added by Go MAEDA 12 months ago

Add Ruby 3.1 to the supported Ruby versions (#36205).

History

#1 Updated by Go MAEDA about 1 year ago

Pavel Rosický wrote:

net/* libraries were gemified, see https://bugs.ruby-lang.org/issues/5481

Thank you for submitting the patch. I added some additional changes as attached to pass tests.

#2 Updated by Go MAEDA about 1 year ago

  • Target version set to 5.0.0

Setting the target version 5.0.0.

#3 Updated by Go MAEDA about 1 year ago

#4 Updated by Go MAEDA about 1 year ago

  • Related to Defect #36226: Psych 4: Psych::DisallowedClass exception when unserializing a setting value added

#5 Updated by Go MAEDA about 1 year ago

  • Related to Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias exception added

#6 Updated by Go MAEDA about 1 year ago

net-smtp, net-imap, and net-pop can be described in Gemfile even if the version of Ruby is older than 3.1.

I think using the same version of gems for all Ruby versions will make it easier to maintain Redmine.

Index: Gemfile
===================================================================
--- Gemfile    (revision 21293)
+++ Gemfile    (working copy)
@@ -18,6 +18,9 @@
 gem "rbpdf", "~> 1.20.0" 
 gem 'addressable'
 gem 'rubyzip', '~> 2.3.0'
+gem 'net-smtp', '~> 0.3.0'
+gem 'net-imap', '~> 0.2.2'
+gem 'net-pop', '~> 0.1.1'

 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
 gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]

#7 Updated by Pavel Rosický about 1 year ago

It seems that Ruby 2.5 is the minimum supported version for these gems and their dependencies. So I think it's ok

#8 Updated by Go MAEDA about 1 year ago

I have committed r21293, r21294, and r21296 and the trunk now passes all tests with Ruby 3.1.

I will commit the following patch after Rails officially supports Ruby 3.1.

diff --git a/Gemfile b/Gemfile
index 73ac9707d..b3f153d22 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,6 +1,6 @@
 source 'https://rubygems.org'

-ruby '>= 2.5.0', '< 3.1.0'
+ruby '>= 2.5.0', '< 3.2.0'
 gem 'bundler', '>= 1.12.0'

 gem 'rails', '6.1.4.1'
diff --git a/doc/INSTALL b/doc/INSTALL
index c0d823b3e..958e54118 100644
--- a/doc/INSTALL
+++ b/doc/INSTALL
@@ -7,7 +7,7 @@ http://www.redmine.org/

 == Requirements

-* Ruby 2.5, 2.6, 2.7, 3.0
+* Ruby 2.5, 2.6, 2.7, 3.0, 3.1
 * Bundler >= 1.12.0

 * A database:

#9 Updated by Go MAEDA 12 months ago

  • Related to Defect #36360: IssuesSystemTest fails with ArgumentError in Ruby 3.1 added

#10 Updated by Go MAEDA 12 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

The trunk r21329 passes the tests with Ruby 3.1.0.

The following warning is displayed at startup due to Thor 1.1.0 but should be resolved in the future release of Thor. See https://github.com/rails/thor/pull/761.

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.

#11 Updated by Pavel Rosický 9 months ago

this change caused a small regression with starttls_auto, but it should be fixed in the mail gem https://github.com/mikel/mail/pull/1435

Also available in: Atom PDF