jdx/mise · error

evaluating the tap definition for {name} requires Ruby 3 or

Error message

evaluating the tap definition for {name} requires Ruby 3 or newer; install a compatible Ruby or run the apply command

What it means

Tap formula definitions are Ruby files that Homebrew evaluates; mise needs a Ruby 3+ interpreter to evaluate them safely. If no compatible Ruby is available (and provisioning one via the brew source path either failed or produced an incompatible Ruby), mise refuses rather than attempting evaluation with an old Ruby that would mis-parse modern formula DSL.

Source

Thrown at src/system/packages/brew/tap.rs:226

        .is_some()
}

async fn ruby_for_metadata(name: &str, provision_ruby: bool) -> Result<PathBuf> {
    if let Some(ruby) = usable_system_ruby().await {
        return Ok(ruby);
    }
    if let Some(ruby) = super::source::installed_ruby_bin().await?
        && ruby_is_compatible(&ruby).await
    {
        return Ok(ruby);
    }
    if provision_ruby {
        let ruby = super::source::ruby_bin().await?;
        if ruby_is_compatible(&ruby).await {
            return Ok(ruby);
        }
    }
    bail!(
        "evaluating the tap definition for {name} requires Ruby 3 or newer; install a compatible Ruby or run the apply command"
    )
}

fn github_repository<'a>(
    owner: &'a str,
    tap: &'a str,
    tap_url: Option<&'a str>,
) -> Result<(&'a str, String)> {
    let Some(url) = tap_url else {
        return Ok((owner, format!("homebrew-{tap}")));
    };
    let normalized = url.trim_end_matches('/').trim_end_matches(".git");
    let rest = normalized
        .strip_prefix("https://github.com/")
        .ok_or_else(|| eyre::eyre!("only GitHub tap URLs can be fetched directly"))?;
    let mut parts = rest.split('/');
    match (parts.next(), parts.next(), parts.next()) {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Install Ruby 3+ (mise: `mise use ruby@3`) and ensure it precedes system Ruby on PATH
  2. Re-run the apply command which provisions a compatible Ruby automatically
  3. Fix network/proxy issues if the brew Ruby provisioning download failed
  4. For macOS, avoid relying on /usr/bin/ruby (2.6); install a modern Ruby first

Example fix

// before: system Ruby 2.6 only
$ ruby --version
ruby 2.6.10
// after
$ mise use ruby@3.3
$ ruby --version
ruby 3.3.0
Defensive patterns

Strategy: validation

Validate before calling

let v = ruby_version();
if v.major < 3 { eprintln!("need Ruby 3+ for tap metadata evaluation"); }

Type guard

fn is_compatible_ruby(v: (u32, u32)) -> bool { v.0 >= 3 }

Prevention

When it happens

Trigger: `formula_from_ruby`/`cask_from_ruby` -> `ruby_for_metadata` where `provision_ruby` was true but `super::source::ruby_bin()` errored, or `ruby_is_compatible` returned false (Ruby < 3); also hit when provision_ruby is false and no compatible system Ruby exists.

Common situations: macOS system Ruby (2.6) being the only Ruby on PATH; mise unable to download its brew-provisioned Ruby (offline or no bottle); a Ruby 2.x shim taking precedence on PATH.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/5335a9ef136c9b2a. Report an issue: GitHub.