Defect #41749
closedWarning during startup: "Unresolved or ambiguous specs during Gem::Specification.reset"
0%
Description
This patch resolves a warning that appears when running bin/rails server
, bin/rails db:migrate
, and similar commands on the Redmine trunk.
WARN: Unresolved or ambiguous specs during Gem::Specification.reset: stringio (>= 0) Available/installed versions of this gem: - 3.1.2 - 3.1.1
Cause:
The warning originates from the following section in the Gemfile:
https://github.com/redmine/redmine/blob/71bcd6df89079b8d33abae39df104a25906b6234/Gemfile#L56
Redmine's Gemfile uses require 'yaml'
to parse config/database.yml for extracting adapter values (e.g., sqlite3, mysql2, postgres) and loading the required database gems:
https://github.com/redmine/redmine/blob/71bcd6df89079b8d33abae39df104a25906b6234/Gemfile#L57-L84
Since yaml depends on the psych gem, which in turn depends on stringio gem, RubyGems encounters an unresolved or ambiguous dependency for stringio, as it cannot determine whether to load version 3.1.1 (bundled with Ruby 3.3.6) or the latest available 3.1.2 version. This ambiguity results in the warning message.
Solution:
To avoid this warning, this patch replaces the use of YAML in the Gemfile for reading database.yml and instead directly extracts adapter values without loading yaml. This eliminates the stringio dependency conflict and removes the warning.
Testing:
All tests have passed in the CI build: CI Results. Additionally, I manually verified that sqlite3 and postgresql work fine.
Files