DEV: Correct the ruby version check (#12551)

DEV: Correct the ruby version check (#12551)

Makes it Ruby 3 compatible.

Co-authored-by: Jarek Radosz jradosz@gmail.com

diff --git a/config/application.rb b/config/application.rb
index 111c989..7fb65e0 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -3,7 +3,7 @@
 # note, we require 2.5.2 and up cause 2.5.1 had some mail bugs we no longer
 # monkey patch, so this avoids people booting with this problem version
 begin
-  if !RUBY_VERSION.match?(/^2\.(([67])|(5\.[2-9]))/)
+  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.2")
     STDERR.puts "Discourse requires Ruby 2.5.2 or up"
     exit 1
   end

GitHub sha: 21b4fef1

This commit appears in #12551 which was approved by CvX. It was merged by CvX.