DEV: Bump ruby version requirement to 3.3.0 (#31538)

This bumps the core ruby version requirement
to at least 3.3.0, and moves this version check
into the Gemfile per
https://bundler.io/guides/gemfile_ruby.html

We are doing this because generally our gems
are using a higher version, it's about time
for a bump anyway.
This commit is contained in:
Martin Brennan 2025-03-04 11:23:32 +10:00 committed by GitHub
parent 028a587363
commit 76e58a55ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 14 deletions

View File

@ -1 +0,0 @@
3.2.1

View File

@ -1,5 +1,7 @@
# frozen_string_literal: true
ruby "~> 3.3.0"
source "https://rubygems.org"
# if there is a super emergency and rubygems is playing up, try
#source 'http://production.cf.rubygems.org'

View File

@ -44,7 +44,7 @@ To get your environment set up, follow one of the setup guides:
- [Ubuntu/Debian](https://meta.discourse.org/t/14727)
- [Windows](https://meta.discourse.org/t/75149)
Before you get started, ensure you have the following minimum versions: [Ruby 3.2+](https://www.ruby-lang.org/en/downloads/), [PostgreSQL 13](https://www.postgresql.org/download/), [Redis 7](https://redis.io/download).
Before you get started, ensure you have the following minimum versions: [Ruby 3.3+](https://www.ruby-lang.org/en/downloads/), [PostgreSQL 13](https://www.postgresql.org/download/), [Redis 7](https://redis.io/download).
For more information, check out [the Developer Documentation](https://meta.discourse.org/c/documentation/developer-guides/56).

View File

@ -1,10 +1,5 @@
# frozen_string_literal: true
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.2.0")
STDERR.puts "Discourse requires Ruby 3.2 or above"
exit 1
end
require File.expand_path("../boot", __FILE__)
require "active_record/railtie"
require "action_controller/railtie"
@ -12,13 +7,6 @@ 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"