Project

General

Profile

Actions

Feature #36205

closed

Ruby 3.1 support

Added by Pavel Rosický about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Ruby support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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'

Files

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

Related issues

Related to Redmine - Defect #36226: Psych 4: Psych::DisallowedClass exception when unserializing a setting valueClosedGo MAEDA

Actions
Related to Redmine - Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias exceptionClosedGo MAEDA

Actions
Related to Redmine - Defect #36360: IssuesSystemTest fails with ArgumentError in Ruby 3.1ClosedGo MAEDA

Actions
Blocked by Redmine - Patch #35025: Update capybara to 3.36ClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA about 2 years 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.

Actions #2

Updated by Go MAEDA about 2 years ago

  • Target version set to 5.0.0

Setting the target version 5.0.0.

Actions #3

Updated by Go MAEDA about 2 years ago

Actions #4

Updated by Go MAEDA about 2 years ago

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

Updated by Go MAEDA about 2 years ago

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

Updated by Go MAEDA about 2 years 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]
Actions #7

Updated by Pavel Rosický about 2 years ago

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

Actions #8

Updated by Go MAEDA about 2 years 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:
Actions #9

Updated by Go MAEDA almost 2 years ago

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

Updated by Go MAEDA almost 2 years 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.
Actions #11

Updated by Pavel Rosický almost 2 years 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

Actions

Also available in: Atom PDF