Merge pull request #50491 from byroot/bump-required-ruby

Bump the required Ruby version to 3.1.0
This commit is contained in:
Jean Boussier 2023-12-31 09:16:59 +01:00 committed by GitHub
commit c2636a615e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 22 additions and 41 deletions

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "WebSocket framework for Rails." s.summary = "WebSocket framework for Rails."
s.description = "Structure many real-time application concerns into channels over a single WebSocket connection." s.description = "Structure many real-time application concerns into channels over a single WebSocket connection."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Inbound email handling framework." s.summary = "Inbound email handling framework."
s.description = "Receive and process incoming emails in Rails applications." s.description = "Receive and process incoming emails in Rails applications."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Email composition and delivery framework (part of Rails)." s.summary = "Email composition and delivery framework (part of Rails)."
s.description = "Email on Rails. Compose, deliver, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments." s.description = "Email on Rails. Compose, deliver, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Web-flow and rendering framework putting the VC in MVC (part of Rails)." s.summary = "Web-flow and rendering framework putting the VC in MVC (part of Rails)."
s.description = "Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server." s.description = "Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Rich text framework." s.summary = "Rich text framework."
s.description = "Edit and display rich text in Rails applications." s.description = "Edit and display rich text in Rails applications."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Rendering framework putting the V in MVC (part of Rails)." s.summary = "Rendering framework putting the V in MVC (part of Rails)."
s.description = "Simple, battle-tested conventions and helpers for building web pages." s.description = "Simple, battle-tested conventions and helpers for building web pages."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Job framework with pluggable queues." s.summary = "Job framework with pluggable queues."
s.description = "Declare job classes that can be run by a variety of queuing backends." s.description = "Declare job classes that can be run by a variety of queuing backends."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "A toolkit for building modeling frameworks (part of Rails)." s.summary = "A toolkit for building modeling frameworks (part of Rails)."
s.description = "A toolkit for building modeling frameworks like Active Record. Rich support for attributes, callbacks, validations, serialization, internationalization, and testing." s.description = "A toolkit for building modeling frameworks like Active Record. Rich support for attributes, callbacks, validations, serialization, internationalization, and testing."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Object-relational mapper framework (part of Rails)." s.summary = "Object-relational mapper framework (part of Rails)."
s.description = "Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in." s.description = "Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Local and cloud file storage framework." s.summary = "Local and cloud file storage framework."
s.description = "Attach cloud and local files in Rails applications." s.description = "Attach cloud and local files in Rails applications."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "A toolkit of support libraries and Ruby core extensions extracted from the Rails framework." s.summary = "A toolkit of support libraries and Ruby core extensions extracted from the Rails framework."
s.description = "A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing." s.description = "A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -170,7 +170,7 @@ irb> Event.where("payload->>'kind' = ?", "user_renamed")
* [type definition](https://www.postgresql.org/docs/current/static/rangetypes.html) * [type definition](https://www.postgresql.org/docs/current/static/rangetypes.html)
* [functions and operators](https://www.postgresql.org/docs/current/static/functions-range.html) * [functions and operators](https://www.postgresql.org/docs/current/static/functions-range.html)
This type is mapped to Ruby [`Range`](https://ruby-doc.org/core-2.7.0/Range.html) objects. This type is mapped to Ruby [`Range`](https://ruby-doc.org/core-3.1.0/Range.html) objects.
```ruby ```ruby
# db/migrate/20130923065404_create_events.rb # db/migrate/20130923065404_create_events.rb
@ -449,7 +449,7 @@ irb> user.save!
* [type definition](https://www.postgresql.org/docs/current/static/datatype-net-types.html) * [type definition](https://www.postgresql.org/docs/current/static/datatype-net-types.html)
The types `inet` and `cidr` are mapped to Ruby The types `inet` and `cidr` are mapped to Ruby
[`IPAddr`](https://ruby-doc.org/stdlib-2.7.0/libdoc/ipaddr/rdoc/IPAddr.html) [`IPAddr`](https://ruby-doc.org/stdlib-3.1.0/libdoc/ipaddr/rdoc/IPAddr.html)
objects. The `macaddr` type is mapped to normal text. objects. The `macaddr` type is mapped to normal text.
```ruby ```ruby

View File

@ -509,8 +509,8 @@ $ bin/rails destroy model Oops
$ bin/rails about $ bin/rails about
About your application's environment About your application's environment
Rails version 7.2.0 Rails version 7.2.0
Ruby version 2.7.0 (x86_64-linux) Ruby version 3.1.0 (x86_64-linux)
RubyGems version 2.7.3 RubyGems version 3.3.7
Rack version 3.0.8 Rack version 3.0.8
JavaScript Runtime Node.js (V8) JavaScript Runtime Node.js (V8)
Middleware: ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActionDispatch::ServerTiming, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper Middleware: ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActionDispatch::ServerTiming, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper

View File

@ -93,10 +93,10 @@ current version of Ruby installed:
```bash ```bash
$ ruby --version $ ruby --version
ruby 2.7.0 ruby 3.1.0
``` ```
Rails requires Ruby version 2.7.0 or later. It is preferred to use the latest Ruby version. Rails requires Ruby version 3.1.0 or later. It is preferred to use the latest Ruby version.
If the version number returned is less than that number (such as 2.3.7, or 1.8.7), If the version number returned is less than that number (such as 2.3.7, or 1.8.7),
you'll need to install a fresh copy of Ruby. you'll need to install a fresh copy of Ruby.

View File

@ -20,7 +20,8 @@ The best way to be sure that your application still works after upgrading is to
Rails generally stays close to the latest released Ruby version when it's released: Rails generally stays close to the latest released Ruby version when it's released:
* Rails 7 requires Ruby 2.7.0 or newer. * Rails 7.2 requires Ruby 3.1.0 or newer.
* Rails 7.0 and 7.1 requires Ruby 2.7.0 or newer.
* Rails 6 requires Ruby 2.5.0 or newer. * Rails 6 requires Ruby 2.5.0 or newer.
* Rails 5 requires Ruby 2.2.2 or newer. * Rails 5 requires Ruby 2.2.2 or newer.

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Full-stack web application framework." s.summary = "Full-stack web application framework."
s.description = "Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration." s.description = "Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.required_rubygems_version = ">= 1.8.11" s.required_rubygems_version = ">= 1.8.11"
s.license = "MIT" s.license = "MIT"

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rails/ruby_version_check"
require "pathname" require "pathname"
require "active_support" require "active_support"

View File

@ -6,7 +6,6 @@ require "rails/app_loader"
# the rest of this script is not run. # the rest of this script is not run.
Rails::AppLoader.exec_app Rails::AppLoader.exec_app
require "rails/ruby_version_check"
Signal.trap("INT") { puts; exit(1) } Signal.trap("INT") { puts; exit(1) }
require "rails/command" require "rails/command"

View File

@ -1,17 +0,0 @@
# frozen_string_literal: true
# :stopdoc:
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7.0") && RUBY_ENGINE == "ruby"
desc = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
abort <<-end_message
Rails 7 requires Ruby 2.7.0 or newer.
You're running
#{desc}
Please upgrade to Ruby 2.7.0 or newer to continue.
end_message
end

View File

@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = "Tools for creating, working with, and running Rails applications." s.summary = "Tools for creating, working with, and running Rails applications."
s.description = "Rails internals: application bootup, plugins, generators, and rake tasks." s.description = "Rails internals: application bootup, plugins, generators, and rake tasks."
s.required_ruby_version = ">= 2.7.0" s.required_ruby_version = ">= 3.1.0"
s.license = "MIT" s.license = "MIT"

View File

@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.summary = "A collection of linters for rails/rails" spec.summary = "A collection of linters for rails/rails"
spec.homepage = "https://github.com/skipkayhil/rail_inspector" spec.homepage = "https://github.com/skipkayhil/rail_inspector"
spec.license = "MIT" spec.license = "MIT"
spec.required_ruby_version = ">= 2.7.0" spec.required_ruby_version = ">= 3.1.0"
spec.metadata["homepage_uri"] = spec.homepage spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage