From a1c623b84b89ee6b8b5483e46ada86d9b9221552 Mon Sep 17 00:00:00 2001 From: jdx <216188+jdx@users.noreply.github.com> Date: Mon, 9 Mar 2026 12:30:26 -0400 Subject: [PATCH] fix(ruby): reject non-MRI Ruby engines on Windows with clear error On Windows, the Ruby plugin uses RubyInstaller2 which only distributes standard MRI Ruby. When a user requests a non-MRI engine like jruby or truffleruby, the plugin would construct an invalid download URL and fail with a confusing 404 error. Now it fails early with a clear message. Fixes #8537 Co-Authored-By: Claude Opus 4.6 --- src/plugins/core/ruby_windows.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/core/ruby_windows.rs b/src/plugins/core/ruby_windows.rs index 967d528d71..4981eed7a9 100644 --- a/src/plugins/core/ruby_windows.rs +++ b/src/plugins/core/ruby_windows.rs @@ -18,7 +18,7 @@ use crate::toolset::{ToolVersion, Toolset}; use crate::ui::progress_report::SingleReport; use crate::{file, github, plugins}; use async_trait::async_trait; -use eyre::Result; +use eyre::{Result, bail}; use itertools::Itertools; use versions::Versioning; use xx::regex; @@ -205,6 +205,13 @@ impl Backend for RubyPlugin { ctx: &InstallContext, mut tv: ToolVersion, ) -> eyre::Result { + if !super::ruby_common::is_mri_version(&tv.version) { + bail!( + "Ruby engine '{}' is not supported on Windows.\n\ + Only standard MRI Ruby versions can be installed via RubyInstaller2.", + tv.version + ); + } let tarball = self.download(&tv, ctx.pr.as_ref()).await?; self.verify_checksum(ctx, &mut tv, &tarball)?; self.install(ctx, &tv, &tarball).await?;