From e74eff217bf4f782155d39715399cfc7c75d49d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 20 Jul 2023 02:05:56 +0200 Subject: [PATCH] Upgrade Ruby to version 3.1.4 Note we updated the `mail` gem in commit 103742847, which is necesary for Ruby 3.1 because it adds the net-smtp dependency. The net-smtp library was removed from Ruby in Ruby 3.1, and if we don't include it, we get an error: ``` cannot load such file -- net/smtp (LoadError) ``` We're also updating the Bundler version in the Gemfile.lock so it's the one included in Ruby 3.1. Without updating it, we get a warning: ``` Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_nam e, spell_checker)' instead. ``` Finally, in order to make Capistrano work, we need to add a couple more changes: * Make the net-ssh gem compatible with SSL 3.0; done in commit b2eec088b * Explicitly allow aliases in the `deploy-secrets.yml` file because Psych 4.x (included in Ruby 3.1) doesn't load aliases without this option --- .gitlab-ci.yml | 4 ++-- .ruby-version | 2 +- Dockerfile | 2 +- Gemfile.lock | 2 +- README.md | 2 +- README_ES.md | 2 +- config/deploy.rb | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91d0e3c9a..f0253b5ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - lint tests: - image: "ruby:3.0.6" + image: "ruby:3.1.4" stage: test services: - postgres:10.10 @@ -34,7 +34,7 @@ tests: # PRONTO_GITLAB_API_PRIVATE_TOKEN to your repository CI/CD settings # giving it the value of the Personal Access Token linters: - image: "ruby:3.0.6" + image: "ruby:3.1.4" stage: lint cache: key: consul diff --git a/.ruby-version b/.ruby-version index 818bd47ab..0aec50e6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.6 +3.1.4 diff --git a/Dockerfile b/Dockerfile index dee67825a..497ec81fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.0.6-buster +FROM ruby:3.1.4-buster ENV DEBIAN_FRONTEND noninteractive diff --git a/Gemfile.lock b/Gemfile.lock index ec7840abd..6cc8e2611 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -784,4 +784,4 @@ DEPENDENCIES wkhtmltopdf-binary (~> 0.12.6) BUNDLED WITH - 2.2.33 + 2.3.26 diff --git a/README.md b/README.md index 9dd0f3403..adbdc625b 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You can access the main website of the project at [http://consuldemocracy.org](h **NOTE**: For more detailed instructions check the [docs](https://docs.consuldemocracy.org) -Prerequisites: install git, Ruby 3.0.6, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5). +Prerequisites: install git, Ruby 3.1.4, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5). ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git diff --git a/README_ES.md b/README_ES.md index 5f48d6da0..b82284b0e 100644 --- a/README_ES.md +++ b/README_ES.md @@ -36,7 +36,7 @@ Puedes acceder a la página principal del proyecto en [http://consuldemocracy.or **NOTA**: para unas instrucciones más detalladas consulta la [documentación](https://docs.consuldemocracy.org) -Prerequisitos: tener instalado git, Ruby 3.0.6, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior). +Prerequisitos: tener instalado git, Ruby 3.1.4, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior). ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git diff --git a/config/deploy.rb b/config/deploy.rb index fc60ff594..b2e89a59a 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,7 +2,7 @@ lock "~> 3.17.1" def deploysecret(key, default: "") - @deploy_secrets_yml ||= YAML.load_file("config/deploy-secrets.yml")[fetch(:stage).to_s] + @deploy_secrets_yml ||= YAML.load_file("config/deploy-secrets.yml", aliases: true)[fetch(:stage).to_s] @deploy_secrets_yml.fetch(key.to_s, default) end