mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:49:06 +08:00
DEV: Update minimum and recommended ruby versions (#19615)
Minimum: 2.7.0 Recommended: 3.1.3
This commit is contained in:
parent
d914ea8366
commit
d24dfe8f96
|
@ -1 +1 @@
|
|||
2.7.6
|
||||
3.1.3
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# 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 Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.2")
|
||||
STDERR.puts "Discourse requires Ruby 2.5.2 or up"
|
||||
exit 1
|
||||
end
|
||||
rescue
|
||||
# no String#match?
|
||||
STDERR.puts "Discourse requires Ruby 2.5.2 or up"
|
||||
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7.0")
|
||||
STDERR.puts "Discourse requires Ruby 2.7 or above"
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
@ -20,6 +12,13 @@ require 'action_view/railtie'
|
|||
require 'action_mailer/railtie'
|
||||
require 'sprockets/railtie'
|
||||
|
||||
if !Rails.env.production?
|
||||
recommended = File.read(".ruby-version.sample").strip
|
||||
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new(recommended)
|
||||
STDERR.puts "[Warning] Discourse recommends developing using Ruby v#{recommended} or above. You are using v#{RUBY_VERSION}."
|
||||
end
|
||||
end
|
||||
|
||||
# Plugin related stuff
|
||||
require_relative '../lib/plugin'
|
||||
require_relative '../lib/discourse_event'
|
||||
|
|
Loading…
Reference in New Issue
Block a user