From fd3efe451acb1cbaf3dbd94b90579729a19cdc1a Mon Sep 17 00:00:00 2001 From: Katsuya HIDAKA Date: Thu, 14 Nov 2024 10:45:57 +0900 Subject: [PATCH 1/3] Fixed "Unresolved or ambiguous specs during Gem::Specification.reset" warning --- Gemfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index cd3e1d0d3..9eae364f8 100644 --- a/Gemfile +++ b/Gemfile @@ -52,16 +52,13 @@ end # Include database gems for the adapters found in the database # configuration file -require 'erb' -require 'yaml' database_file = File.join(File.dirname(__FILE__), "config/database.yml") if File.exist?(database_file) - yaml_config = ERB.new(IO.read(database_file)).result - database_config = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml_config) : YAML.load(yaml_config) - adapters = database_config.values.filter_map {|c| c['adapter']}.uniq + database_config = File.read(database_file) + adapters = database_config.scan(/^ *adapter: *(.*)/).flatten.uniq if adapters.any? adapters.each do |adapter| - case adapter + case adapter.strip when 'mysql2' gem 'mysql2', '~> 0.5.0' gem "with_advisory_lock" -- 2.44.0