Skip to content

Commit 9706210

Browse files
committed
No need to consider older RubyGem versions since Rails main requires Ruby 3.2.0
Ruby 3.2.0 installs RubyGems 3.4.1 as a default gem. We can always use the `Gem.ruby_version` now. * Ruby 3.2.0 Released https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ > The following default gems are updated. > RubyGems 3.4.1 - RubyGems version shipped with Ruby 3.2.0 ```ruby $ ruby -v ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux] $ gem -v 3.4.1 ``` Refer to rails#47584 rails#47669
1 parent 13d5f87 commit 9706210

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

railties/lib/rails/generators/base.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,6 @@ def self.default_generator_root # :doc:
423423
path = File.expand_path(File.join(base_name, generator_name), base_root)
424424
path if File.exist?(path)
425425
end
426-
427-
def gem_ruby_version
428-
Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.3.13") ? Gem.ruby_version : RUBY_VERSION
429-
end
430426
end
431427
end
432428
end

railties/lib/rails/generators/rails/app/templates/Dockerfile.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
99

1010
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
11-
ARG RUBY_VERSION=<%= gem_ruby_version %>
11+
ARG RUBY_VERSION=<%= Gem.ruby_version %>
1212
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
1313

1414
# Rails app lives here
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
2-
ARG RUBY_VERSION=<%= gem_ruby_version %>
2+
ARG RUBY_VERSION=<%= Gem.ruby_version %>
33
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION

railties/test/generators/generators_test_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ def run_app_update(app_root = destination_root, flags: "--force")
151151
private
152152
def gemfile_locals
153153
{
154-
gem_ruby_version: RUBY_VERSION,
155154
rails_prerelease: false,
156155
skip_active_storage: true,
157156
depend_on_bootsnap: false,

0 commit comments

Comments
 (0)