From 07f6a91d022f258ba76436fb56cd93689d100fec Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Thu, 30 May 2024 23:28:13 +0200 Subject: [PATCH] Upgrade to ruby 3.3 --- .github/workflows/ci.yml | 4 ++-- .ruby-version | 2 +- Changelog.md | 4 ++-- Gemfile.lock | 2 +- config/boot.rb | 8 ++++++++ docker/develop/Dockerfile | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9bb078e7..baef2aab2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: ruby: - - '3.0' - - '3.1' + - '3.2' + - '3.3' db: - mysql - postgresql diff --git a/.ruby-version b/.ruby-version index 8c50098d8..eb39e5382 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1 +3.3 diff --git a/Changelog.md b/Changelog.md index 114d08405..7251c62e0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -34,9 +34,9 @@ With this release, we switched from `unicorn` to `puma` to run our applications. We use yarn to install the frontend dependencies now, so you need to have that installed. See here for how to install it: https://yarnpkg.com/en/docs/install -## Suggested Ruby version: 3.1 +## Suggested Ruby version: 3.3 -We recommend setting up new pods using Ruby 3.1, and updating existing pods to this version as well. Ruby 2.7 is EOL and no longer supported. +We recommend setting up new pods using Ruby 3.3, and updating existing pods to this version as well. Ruby 2.7 is EOL and no longer supported. ## Refactor * Add bootstrapping for using ECMAScript 6 with automatic transpiling for compatibility [#7581](https://github.com/diaspora/diaspora/pull/7581) [#8397](https://github.com/diaspora/diaspora/pull/8397) diff --git a/Gemfile.lock b/Gemfile.lock index e66bffaf8..3e3a506bb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -913,4 +913,4 @@ DEPENDENCIES yajl-ruby (= 1.4.3) BUNDLED WITH - 2.3.27 + 2.5.9 diff --git a/config/boot.rb b/config/boot.rb index 4fe16d4e8..35f16d8a6 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -6,3 +6,11 @@ require "bundler/setup" # Set up gems listed in the Gemfile. # Load configuration early require_relative "load_config" + +# Ruby 3.2 removed the `exists?` alias from `File`, but at least the `logging-rails` gem still uses it. +# This is only a workaround, and we need a different long-term solution. It looks like the `logging-rails` gem +# is not maintained anymore, so we maybe need to find a replacement. But since this is the only thing preventing +# us from upgrading to Ruby >= 3.2, we can just create our own alias for now. +class << File + alias exists? exist? +end diff --git a/docker/develop/Dockerfile b/docker/develop/Dockerfile index ccf705ac9..8afaee119 100644 --- a/docker/develop/Dockerfile +++ b/docker/develop/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/amd64/ruby:3.1-slim-bullseye +FROM docker.io/amd64/ruby:3.3-slim-bullseye RUN DEBIAN_FRONTEND=noninteractive \ apt-get update && \