jdx/mise · error

evaluating the tap definition for

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

Evaluating a tap's Ruby formula/cask requires a Ruby 3+ interpreter. When ruby_for_metadata is asked to provision Ruby and the available Ruby (from the brew source resolver) is too old or missing, it refuses to evaluate the tap definition and tells the user to install a compatible Ruby or use the apply command path.

Solutions

  1. Install a Ruby 3+ via mise (`mise use ruby@3`) so it is on PATH
  2. Let mise provision Ruby (run with provisioning enabled instead of disabling it)
  3. Use the apply command path, which does not require Ruby evaluation of the tap
  4. Remove the ancient system Ruby from PATH so a compatible one is found

Example fix

// before
mise install brew:tap/formula   # uses system ruby 2.6
// after
mise use ruby@3.3
mise install brew:tap/formula
Defensive patterns

Strategy: validation

Validate before calling

const RUBY: &str = "ruby";
let v = std::process::Command::new(RUBY).arg("-e")
    .arg("puts RUBY_VERSION.to_i")
    .output()?;
if String::from_utf8_lossy(&v.stdout).trim() != "3" {
    // install Ruby 3 via mise before running the tap install
}

Try / catch

match result {
    Err(e) if e.to_string().contains("requires Ruby 3 or newer") => install_ruby3_then_retry(),
    other => other,
}

Prevention

When it happens

Trigger: formula_from_ruby or cask_from_ruby calls ruby_for_metadata with provision_ruby=true, but ruby_bin() returns a Ruby whose version check ruby_is_compatible() fails (Ruby < 3), or provision_ruby is false and no compatible Ruby is configured.

Common situations: Old macOS system Ruby (2.6) on PATH; mise's Ruby toolset absent; CI images with only legacy Ruby installed; disabling provisioning intentionally and forgetting to provide Ruby 3.

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@533346cc37 (2026-09-17). Data as JSON: /api/errors/5335a9ef136c9b2a. Report an issue: GitHub.

Appendix: 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 533346cc37)