{"record":{"id":"9b29cd0e721b09c9","repo":"windmill-labs/windmill","slug":"require-windmill-inline-is-not-detected-plea","errorCode":null,"errorMessage":"`require 'windmill/inline'` is not detected - please add `require 'windmill/inline'` in order to use inline gemfile.\n                Your Gemfile syntax will be compatible with bundler/inline.","messagePattern":"`require 'windmill/inline'` is not detected - please add `require 'windmill/inline'` in order to use inline gemfile\\.\n                Your Gemfile syntax will be compatible with bundler/inline\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-ruby/src/lib.rs","lineNumber":88,"sourceCode":"        if x.kind() == \"call\" {\n            for (i, n) in x.children(&mut x.walk()).enumerate() {\n                if i == 0\n                    && n.kind() == \"identifier\"\n                    && !n\n                        .utf8_text(code.as_bytes())\n                        .map(|ident| ident == \"gemfile\")\n                        .unwrap_or_default()\n                {\n                    continue 'top_level;\n                } else if n.kind() == \"do_block\" {\n                    let req = n.utf8_text(code.as_bytes())?.to_owned();\n\n                    lazy_static::lazy_static! {\n                        static ref WINDMILL_RE: Regex = Regex::new(r\"(?m)^\\s*require\\s*'windmill/inline'\").unwrap();\n                    }\n\n                    if WINDMILL_RE.find(&code).is_none() {\n                        return Err(anyhow!(\n                            \"`require 'windmill/inline'` is not detected - please add `require 'windmill/inline'` in order to use inline gemfile.\n                Your Gemfile syntax will be compatible with bundler/inline.\"\n                        )\n                        .into());\n                    }\n\n                    return req\n                        // gemfile do_block comes with 'do' and 'end'\n                        // we want to omit these by taking slice\n                        .get(2..(req.len() - 3))\n                        .map(str::to_owned)\n                        .ok_or(anyhow!(\"Invalid gemfile do block\"));\n                }\n            }\n        }\n    }\n    Ok(String::new())\n}","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-ruby/src/lib.rs#L70-L106","documentation":"When a Ruby script uses bundler/inline Gemfile syntax (`gemfile do ... end`), Windmill requires the script to first `require 'windmill/inline'` so the inline `gem` method is available at run time. `parse_ruby_requirements` regex-checks for that require line and raises this error when it is missing, telling the user exactly what to add.","triggerScenarios":"A Ruby script containing `gemfile do ... end` (detected via `require 'bundler/inline'` or gemfile block) but whose source lacks a line matching /^\\s*require\\s*'windmill\\/inline'/.","commonSituations":"Scripts copied from plain bundler examples that only `require 'bundler/inline'`; users writing `require \"windmill/inline\"` with double quotes (the regex only matches single quotes); leading whitespace is OK, but `require 'windmill/inline'` placed after the gemfile block or inside a conditional string may still match as long as it is at line start (with optional whitespace) somewhere in the file.","solutions":["Add `require 'windmill/inline'` on its own line (single quotes) at the top of the script before the gemfile block","Note the regex only matches single quotes — use `require 'windmill/inline'`, not `require \"windmill/inline\"`","If you don't need inline gems, remove the `gemfile do ... end` block and declare dependencies in additionalImports/requirements instead"],"exampleFix":"// before\nrequire 'bundler/inline'\ngemfile do\n  gem 'httparty'\nend\n// after\nrequire 'bundler/inline'\nrequire 'windmill/inline'\ngemfile do\n  gem 'httparty'\nend","handlingStrategy":"validation","validationCode":"// # Ruby-side pre-check you can run before deploying the script:\n// has_gemfile = code =~ /^\\s*gemfile\\s+do/\n// has_require  = code =~ /^\\s*require\\s+'windmill\\/inline'/\n// if has_gemfile && !has_require\n//   raise \"add require 'windmill/inline' (single quotes) before the gemfile block\"\n// end","typeGuard":null,"tryCatchPattern":"match parse_ruby_requirements(code) {\n    Ok(gemfile) => gemfile,\n    Err(e) if e.to_string().contains(\"windmill/inline\") => {\n        // actionable user error: surface verbatim, it already contains the fix\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always put `require 'windmill/inline'` (single quotes) at the top of scripts using gemfile do blocks","Remember double-quoted require \"windmill/inline\" does NOT match the library's regex","Use the script's dedicated requirements/import field instead of inline gemfile when you don't need bundler semantics"],"tags":["ruby","gemfile","bundler","validation"],"backgroundTag":"missing-required-require-statement","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}