From ca379a782a3e23f3f570715a6024cfa1f37d37d9 Mon Sep 17 00:00:00 2001 From: aaron-congo Date: Wed, 28 Oct 2026 10:25:58 -0700 Subject: [PATCH] Document mysql2's fiddle requirement for windows Ruby >= 4.0 --- content/failover.yaml | 14 ++++++++++++++ site/docs-ruby/overview.md | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/content/failover.yaml b/content/failover.yaml index 4800894..53a4028 100644 --- a/content/failover.yaml +++ b/content/failover.yaml @@ -91,6 +91,20 @@ wrappers: `require 'aws_advanced_ruby_driver_wrapper'`). That single require registers the Active Record adapters and makes the connection classes, error classes, and other public API available for direct use. + # The wrapper itself declares every gem it requires. This warning is + # for a gem `mysql2` requires on Windows without declaring it. + - text: | + :::warning + If you are using `mysql2` on Windows with Ruby 4.0 or later, also add `fiddle` to your Gemfile: + + ```ruby + gem 'fiddle' + ``` + + On Windows, `mysql2` uses `fiddle` to load `libmysql.dll` but does not + declare it as a dependency. Ruby 4.0 removed `fiddle` from the default + gems, so a bundle without it raises `LoadError` when `mysql2` is required. + ::: - title: "2. Point Active Record at your cluster" blocks: diff --git a/site/docs-ruby/overview.md b/site/docs-ruby/overview.md index 13c7535..e077a12 100644 --- a/site/docs-ruby/overview.md +++ b/site/docs-ruby/overview.md @@ -37,6 +37,19 @@ bundle install Bundler requires the gem for you (in a plain Ruby script, add `require 'aws_advanced_ruby_driver_wrapper'`). That single require registers the Active Record adapters and makes the connection classes, error classes, and other public API available for direct use. +:::warning +If you are using `mysql2` on Windows with Ruby 4.0 or later, also add `fiddle` to your Gemfile: + +```ruby +gem 'fiddle' +``` + +On Windows, `mysql2` uses `fiddle` to load `libmysql.dll` but does not +declare it as a dependency. Ruby 4.0 removed `fiddle` from the default +gems, so a bundle without it raises `LoadError` when `mysql2` is required. +::: + + ### 2. Point Active Record at your cluster The wrapper registers two adapters, `aws_postgresql` and `aws_mysql2`, which are drop-in replacements for `postgresql` and `mysql2`. Change the adapter name and point the host at your cluster endpoint: