Re: git: 097770c474d4 - main - Mk/bsd.default-versions.mk: Change default version of Ruby

From: Yasuhiro Kimura <yasu_at_FreeBSD.org>
Date: Thu, 16 Mar 2023 08:33:27 UTC
From: Matthias Fechner <mfechner@freebsd.org>
Subject: Re: git: 097770c474d4 - main - Mk/bsd.default-versions.mk: Change default version of Ruby
Date: Thu, 16 Mar 2023 09:58:46 +0200

> Thanks for this, I added now net-smtp but now I get another error
> message:
> root@gitlab:~ # su -l git -c "cd /usr/local/www/gitlab-ce && rake
> db:migrate RAILS_ENV=production --trace"
> ** Invoke db:migrate (first_time)
> ** Invoke db:load_config (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> rake aborted!
> Psych::BadAlias: Unknown alias: base

Googling with this error message lists following pages.

(a) ruby on rails - visit_Psych_Nodes_Alias: Unknown alias: default (Psych::BadAlias) - Stack Overflow
    https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
(b) Defect #35435: Psych 4: aliases in database.yml cause Psych::BadAlias exception - Redmine
    https://www.redmine.org/issues/35435
(c) Psych 4 included in Ruby 3.1 complains when using aliases in config · Issue #5140 · sidekiq/sidekiq
    https://github.com/sidekiq/sidekiq/issues/5140

According to them,

1. In Ruby 3.1 Psych is updated to 4.
2. There is incompatibility between Psych 3 and Psych 4.
3. To make program work with both Psych 3 and 4, a bit complex
   handling such as one written in first answer of (a) is necessary.
4. One workaround is to add "gem 'psych', '~> 3.1'" to gemfile.

HTH.

---
Yasuhiro Kimura