{"record":{"id":"5335a9ef136c9b2a","repo":"jdx/mise","slug":"evaluating-the-tap-definition-for-name-requires","errorCode":null,"errorMessage":"evaluating the tap definition for {name} requires Ruby 3 or newer; install a compatible Ruby or run the apply command","messagePattern":"evaluating the tap definition for (.+?) requires Ruby 3 or newer; install a compatible Ruby or run the apply command","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/tap.rs","lineNumber":226,"sourceCode":"        .is_some()\n}\n\nasync fn ruby_for_metadata(name: &str, provision_ruby: bool) -> Result<PathBuf> {\n    if let Some(ruby) = usable_system_ruby().await {\n        return Ok(ruby);\n    }\n    if let Some(ruby) = super::source::installed_ruby_bin().await?\n        && ruby_is_compatible(&ruby).await\n    {\n        return Ok(ruby);\n    }\n    if provision_ruby {\n        let ruby = super::source::ruby_bin().await?;\n        if ruby_is_compatible(&ruby).await {\n            return Ok(ruby);\n        }\n    }\n    bail!(\n        \"evaluating the tap definition for {name} requires Ruby 3 or newer; install a compatible Ruby or run the apply command\"\n    )\n}\n\nfn github_repository<'a>(\n    owner: &'a str,\n    tap: &'a str,\n    tap_url: Option<&'a str>,\n) -> Result<(&'a str, String)> {\n    let Some(url) = tap_url else {\n        return Ok((owner, format!(\"homebrew-{tap}\")));\n    };\n    let normalized = url.trim_end_matches('/').trim_end_matches(\".git\");\n    let rest = normalized\n        .strip_prefix(\"https://github.com/\")\n        .ok_or_else(|| eyre::eyre!(\"only GitHub tap URLs can be fetched directly\"))?;\n    let mut parts = rest.split('/');\n    match (parts.next(), parts.next(), parts.next()) {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/brew/tap.rs#L208-L244","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install a Ruby 3+ via mise (`mise use ruby@3`) so it is on PATH","Let mise provision Ruby (run with provisioning enabled instead of disabling it)","Use the apply command path, which does not require Ruby evaluation of the tap","Remove the ancient system Ruby from PATH so a compatible one is found"],"exampleFix":"// before\nmise install brew:tap/formula   # uses system ruby 2.6\n// after\nmise use ruby@3.3\nmise install brew:tap/formula","handlingStrategy":"validation","validationCode":"const RUBY: &str = \"ruby\";\nlet v = std::process::Command::new(RUBY).arg(\"-e\")\n    .arg(\"puts RUBY_VERSION.to_i\")\n    .output()?;\nif String::from_utf8_lossy(&v.stdout).trim() != \"3\" {\n    // install Ruby 3 via mise before running the tap install\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"requires Ruby 3 or newer\") => install_ruby3_then_retry(),\n    other => other,\n}","preventionTips":["Keep a Ruby 3+ on PATH (mise use ruby@3) when working with third-party taps","Don't disable Ruby provisioning unless you supply Ruby yourself"],"tags":["brew","ruby","version"],"backgroundTag":"missing-dependency","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}