From 39bfd836c6d97e8c9768b386c188169ceccbf1ff Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 22 May 2018 09:21:47 +1000 Subject: [PATCH] FEATURE: do not boot Ruby if not on 2.4 or up --- config/application.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/application.rb b/config/application.rb index ca68d22681..93efe88702 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,5 +1,16 @@ # frozen_string_literal: true +begin + if !RUBY_VERSION.match?(/^2\.[456]/) + STDERR.puts "Discourse requires Ruby 2.4.0 or up" + exit 1 + end +rescue + # no String#match? + STDERR.puts "Discourse requires Ruby 2.4.0 or up" + exit 1 +end + require File.expand_path('../boot', __FILE__) require 'rails/all'