From d026adedf16037cc0c65ba745e07e86b46f9693a Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Tue, 21 May 2024 16:55:39 +0200 Subject: [PATCH] Require new "rails/console/methods" for Rails 8 This replaced "rails/console/app". See https://github.com/rails/rails/pull/51760 --- .github/workflows/build.yml | 2 +- Gemfile.lock | 6 ++++-- lib/console1984/supervisor.rb | 9 +++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0c6796..7302b44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [3.0.3] + ruby-version: [3.0.3, 3.3.0] database: [sqlite, postgres, mysql] services: redis: diff --git a/Gemfile.lock b/Gemfile.lock index b195e26..572ec38 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,6 +111,7 @@ GEM marcel (1.0.4) method_source (1.0.0) mini_mime (1.1.5) + mini_portile2 (2.8.6) minitest (5.18.1) mocha (2.0.4) ruby2_keywords (>= 0.0.5) @@ -197,8 +198,8 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) - sqlite3 (1.6.3-arm64-darwin) - sqlite3 (1.6.3-x86_64-linux) + sqlite3 (1.6.3) + mini_portile2 (~> 2.8.0) thor (1.3.1) timeout (0.4.1) tzinfo (2.0.6) @@ -211,6 +212,7 @@ GEM PLATFORMS arm64-darwin-21 + arm64-darwin-22 x86_64-linux DEPENDENCIES diff --git a/lib/console1984/supervisor.rb b/lib/console1984/supervisor.rb index 9059ca4..f4c0086 100644 --- a/lib/console1984/supervisor.rb +++ b/lib/console1984/supervisor.rb @@ -1,5 +1,10 @@ -require 'active_support/all' -require 'rails/console/app' +require "active_support/all" + +if Rails.version >= "8" + require "rails/console/methods" +else + require "rails/console/app" +end # Entry point to the system. In charge of installing everything # and starting and stopping sessions.