From 6487836af8f50648a9b30ce61864c827132e5592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 4 Feb 2021 16:34:53 +0000 Subject: [PATCH] Rails 7 requires Ruby 2.7 and prefer Ruby 3+ The code cleanup is comming in later commits but this already remove support to Ruby < 2.7. --- actioncable/actioncable.gemspec | 2 +- actionmailbox/actionmailbox.gemspec | 2 +- actionmailer/actionmailer.gemspec | 2 +- actionpack/actionpack.gemspec | 2 +- actiontext/actiontext.gemspec | 2 +- actionview/actionview.gemspec | 2 +- activejob/activejob.gemspec | 2 +- activemodel/activemodel.gemspec | 2 +- activerecord/activerecord.gemspec | 2 +- activestorage/activestorage.gemspec | 2 +- activesupport/activesupport.gemspec | 2 +- guides/source/active_record_postgresql.md | 4 ++-- guides/source/command_line.md | 2 +- guides/source/getting_started.md | 4 ++-- guides/source/upgrading_ruby_on_rails.md | 1 + rails.gemspec | 2 +- railties/lib/rails/ruby_version_check.rb | 6 +++--- railties/railties.gemspec | 2 +- 18 files changed, 22 insertions(+), 21 deletions(-) diff --git a/actioncable/actioncable.gemspec b/actioncable/actioncable.gemspec index e15c836648..8e7db21602 100644 --- a/actioncable/actioncable.gemspec +++ b/actioncable/actioncable.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "WebSocket framework for Rails." s.description = "Structure many real-time application concerns into channels over a single WebSocket connection." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/actionmailbox/actionmailbox.gemspec b/actionmailbox/actionmailbox.gemspec index 47501b1cd1..a32ccbeac3 100644 --- a/actionmailbox/actionmailbox.gemspec +++ b/actionmailbox/actionmailbox.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "Inbound email handling framework." s.description = "Receive and process incoming emails in Rails applications." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index 4d01a6fbda..5013d7788f 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| 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.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec index 3608a1cc61..4d283a6b8b 100644 --- a/actionpack/actionpack.gemspec +++ b/actionpack/actionpack.gemspec @@ -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.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.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/actiontext/actiontext.gemspec b/actiontext/actiontext.gemspec index 8c5e6564e3..53b7c93517 100644 --- a/actiontext/actiontext.gemspec +++ b/actiontext/actiontext.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "Rich text framework." s.description = "Edit and display rich text in Rails applications." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/actionview/actionview.gemspec b/actionview/actionview.gemspec index 69cef1e8e5..e40f2607f1 100644 --- a/actionview/actionview.gemspec +++ b/actionview/actionview.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| 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.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/activejob/activejob.gemspec b/activejob/activejob.gemspec index 9775cb2983..67c4336d2c 100644 --- a/activejob/activejob.gemspec +++ b/activejob/activejob.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "Job framework with pluggable queues." s.description = "Declare job classes that can be run by a variety of queuing backends." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/activemodel/activemodel.gemspec b/activemodel/activemodel.gemspec index 30a0697d38..f6ac05c8e1 100644 --- a/activemodel/activemodel.gemspec +++ b/activemodel/activemodel.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| 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.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/activerecord/activerecord.gemspec b/activerecord/activerecord.gemspec index 1e295fc27c..61a065d0ac 100644 --- a/activerecord/activerecord.gemspec +++ b/activerecord/activerecord.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| 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.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/activestorage/activestorage.gemspec b/activestorage/activestorage.gemspec index f15f9bfccf..e3a4c13149 100644 --- a/activestorage/activestorage.gemspec +++ b/activestorage/activestorage.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "Local and cloud file storage framework." s.description = "Attach cloud and local files in Rails applications." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 72cd995f02..55b5bce918 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -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.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.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT" diff --git a/guides/source/active_record_postgresql.md b/guides/source/active_record_postgresql.md index 6ed224a294..60e765f4f2 100644 --- a/guides/source/active_record_postgresql.md +++ b/guides/source/active_record_postgresql.md @@ -166,7 +166,7 @@ irb> Event.where("payload->>'kind' = ?", "user_renamed") * [type definition](https://www.postgresql.org/docs/current/static/rangetypes.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.5.0/Range.html) objects. +This type is mapped to Ruby [`Range`](https://ruby-doc.org/core-2.7.0/Range.html) objects. ```ruby # db/migrate/20130923065404_create_events.rb @@ -408,7 +408,7 @@ irb> user.save! * [type definition](https://www.postgresql.org/docs/current/static/datatype-net-types.html) The types `inet` and `cidr` are mapped to Ruby -[`IPAddr`](https://ruby-doc.org/stdlib-2.5.0/libdoc/ipaddr/rdoc/IPAddr.html) +[`IPAddr`](https://ruby-doc.org/stdlib-2.7.0/libdoc/ipaddr/rdoc/IPAddr.html) objects. The `macaddr` type is mapped to normal text. ```ruby diff --git a/guides/source/command_line.md b/guides/source/command_line.md index a3942be7fb..6cc751ebd3 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -454,7 +454,7 @@ $ bin/rails destroy model Oops $ bin/rails about About your application's environment Rails version 6.0.0 -Ruby version 2.5.0 (x86_64-linux) +Ruby version 2.7.0 (x86_64-linux) RubyGems version 2.7.3 Rack version 2.0.4 JavaScript Runtime Node.js (V8) diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 04ecc074cd..197e1c2b2b 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -95,10 +95,10 @@ current version of Ruby installed: ```bash $ ruby --version -ruby 2.5.0 +ruby 2.7.0 ``` -Rails requires Ruby version 2.5.0 or later. If the version number returned is +Rails requires Ruby version 2.7.0 or later. 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. To install Rails on Windows, you'll first need to install [Ruby Installer](https://rubyinstaller.org/). diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index ba0c45198f..a1af3d399f 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -35,6 +35,7 @@ You can find a list of all released Rails versions [here](https://rubygems.org/g Rails generally stays close to the latest released Ruby version when it's released: +* Rails 6 requires Ruby 2.7.0 or newer. * Rails 6 requires Ruby 2.5.0 or newer. * Rails 5 requires Ruby 2.2.2 or newer. * Rails 4 prefers Ruby 2.0 and requires 1.9.3 or newer. diff --git a/rails.gemspec b/rails.gemspec index 411da07f39..3bb12a61d9 100644 --- a/rails.gemspec +++ b/rails.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| 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.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.required_rubygems_version = ">= 1.8.11" s.license = "MIT" diff --git a/railties/lib/rails/ruby_version_check.rb b/railties/lib/rails/ruby_version_check.rb index ab5339bf24..8b2a8c2383 100644 --- a/railties/lib/rails/ruby_version_check.rb +++ b/railties/lib/rails/ruby_version_check.rb @@ -1,15 +1,15 @@ # frozen_string_literal: true -if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.5.0") && RUBY_ENGINE == "ruby" +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 6 requires Ruby 2.5.0 or newer. + Rails 7 requires Ruby 2.7.0 or newer. You're running #{desc} - Please upgrade to Ruby 2.5.0 or newer to continue. + Please upgrade to Ruby 2.7.0 or newer to continue. end_message end diff --git a/railties/railties.gemspec b/railties/railties.gemspec index 7ff271a303..0320f2ed5f 100644 --- a/railties/railties.gemspec +++ b/railties/railties.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.summary = "Tools for creating, working with, and running Rails applications." s.description = "Rails internals: application bootup, plugins, generators, and rake tasks." - s.required_ruby_version = ">= 2.5.0" + s.required_ruby_version = ">= 2.7.0" s.license = "MIT"