{"record":{"id":"74a68956829449cd","repo":"can1357/oh-my-pi","slug":"ruby-kernel-unavailable","errorCode":null,"errorMessage":"Ruby kernel unavailable","messagePattern":"Ruby kernel unavailable","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/eval/rb/executor.ts","lineNumber":189,"sourceCode":"\t\tcode,\n\t\toptions,\n\t\trunIdPrefix: \"rb\",\n\t\terrorLogLabel: \"Ruby\",\n\t\tcancelledErrorClass: RubyExecutionCancelledError,\n\t\tbuildKernelEnvPatch: buildManagedKernelEnvPatch,\n\t\tformatKernelTimeoutAnnotation,\n\t\tformatTimeoutAnnotation,\n\t});\n}\n\nasync function ensureKernelAvailable(cwd: string, options: RubyExecutorOptions): Promise<void> {\n\tconst availability = await waitForPromiseWithCancellation(\n\t\tcheckRubyKernelAvailability(cwd, options.interpreter),\n\t\toptions,\n\t\tRubyExecutionCancelledError,\n\t);\n\tif (!availability.ok) {\n\t\tthrow new Error(availability.reason ?? \"Ruby kernel unavailable\");\n\t}\n}\n\nasync function ensureToolBridge(options: RubyExecutorOptions): Promise<void> {\n\tif (!options.toolSession || options.bridge) return;\n\ttry {\n\t\toptions.bridge = await ensurePyToolBridge();\n\t} catch (err) {\n\t\tlogger.warn(\"Failed to start Ruby tool bridge\", {\n\t\t\terror: err instanceof Error ? err.message : String(err),\n\t\t});\n\t}\n}\n\nconst sessionRegistry = createKernelSessionRegistry<\n\tRubyKernel,\n\tRubyExecutorOptions,\n\tRubyResult,","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/eval/rb/executor.ts#L171-L207","documentation":"Before executing Ruby eval code, `ensureKernelAvailable` runs `checkRubyKernelAvailability(cwd, options.interpreter)` to probe for a usable Ruby kernel/runtime. If the probe returns not-ok and carries no specific reason, this generic fallback error is thrown. It means the executor could not find or validate a Ruby environment capable of hosting the kernel.","triggerScenarios":"Calling the Ruby executor (executeRuby → ensureKernelAvailable) when checkRubyKernelAvailability fails — no usable Ruby interpreter found at/below the given interpreter path, or the availability probe errored with an empty reason.","commonSituations":"Ruby is not installed or not on PATH; a custom `options.interpreter` points to a missing/wrong binary; the required kernel gem/bundle is absent; environment restrictions (PATH, sandbox, container) hide the interpreter.","solutions":["Verify a working Ruby is available: run `ruby -v` in the target cwd and install Ruby if missing.","Check/correct the `interpreter` option passed to the executor — point it at a valid Ruby binary.","Install the Ruby kernel dependencies the availability probe expects (kernel gem/bundle) for the selected interpreter.","If the error message lacks a reason, run the availability check directly (checkRubyKernelAvailability) to get the underlying probe failure."],"exampleFix":"// before: no interpreter resolved in the executor options\nconst result = await executeRuby(code, { cwd: \"/work\" });\n\n// after: pin a verified interpreter\nconst result = await executeRuby(code, {\n  cwd: \"/work\",\n  interpreter: \"/usr/bin/ruby\", // verified via `ruby -v`\n});","handlingStrategy":"validation","validationCode":"const { checkRubyKernelAvailability } = await import(\"./eval/rb/kernel\");\nconst availability = await checkRubyKernelAvailability(cwd, interpreter);\nif (!availability.ok) {\n  throw new Error(`Ruby environment not usable: ${availability.reason ?? \"no reason provided\"}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ensureKernelAvailable(options);\n} catch (err) {\n  if (err instanceof Error && err.message === \"Ruby kernel unavailable\") {\n    // fall back to another executor or surface an install-Ruby hint\n    return fallbackExecutor ?? null;\n  }\n  throw err;\n}","preventionTips":["Pin options.interpreter to an absolute Ruby path in CI/containers.","Probe availability once at startup and fail fast with a clear message.","Ensure `ruby -v` works for the same user/PATH the host process runs under."],"tags":["ruby","kernel","environment","missing-interpreter"],"backgroundTag":"runtime-not-available","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}