{"record":{"id":"1768875b44b26a62","repo":"SeleniumHQ/selenium","slug":"unknown-os-host-os-inspect","errorCode":null,"errorMessage":"unknown os: #{host_os.inspect}","messagePattern":"unknown os: #(.+?)","errorType":"exception","errorClass":"Error::WebDriverError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/platform.rb","lineNumber":49,"sourceCode":"      end\n\n      def engine\n        @engine ||= RUBY_ENGINE.to_sym\n      end\n\n      def os\n        host_os = RbConfig::CONFIG['host_os']\n        @os ||= case host_os\n                when /mswin|msys|mingw|cygwin|bccwin|wince|emc/\n                  :windows\n                when /darwin|mac os/\n                  :macosx\n                when /linux/\n                  :linux\n                when /solaris|bsd/\n                  :unix\n                else\n                  raise Error::WebDriverError, \"unknown os: #{host_os.inspect}\"\n                end\n      end\n\n      def ci\n        if ENV['JENKINS']\n          :jenkins\n        elsif ENV['APPVEYOR']\n          :appveyor\n        elsif ENV['GITHUB_ACTIONS']\n          :github\n        end\n      end\n\n      def jruby?\n        engine == :jruby\n      end\n\n      def truffleruby?","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/platform.rb#L31-L67","documentation":"Platform.os infers the operating system from RbConfig::CONFIG['host_os'] using a series of regexes (Windows, macOS, Linux, Solaris/BSD). If none match, it raises WebDriverError with the unrecognized host_os string. This is a low-level detection routine relied upon by many platform-specific code paths.","triggerScenarios":"Running on an OS whose host_os string is not covered, e.g. Haiku, AIX, some niche BSD variants, or an embedded platform. A Ruby build reporting an unusual host_os value.","commonSituations":"Running Selenium on a non-mainstream or experimental OS. CI on an unusual container image. This is extremely rare on Windows/macOS/Linux.","solutions":["Run Selenium on a supported OS: Windows, macOS, Linux, Solaris, or BSD.","If you must run on another OS, monkey-patch Platform.os to return a sensible value, or contribute a regex for your host_os.","Check RbConfig::CONFIG['host_os'] on the target machine to understand why detection failed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"host_os = RbConfig::CONFIG['host_os']\nunless /mswin|msys|mingw|cygwin|bccwin|wince|emc|darwin|mac os|linux|solaris|bsd/ =~ host_os\n  warn \"unsupported host_os: #{host_os}\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  Selenium::WebDriver::Platform.os\nrescue Selenium::WebDriver::Error::WebDriverError => e\n  raise unless e.message.include?('unknown os')\n  :linux # assume a fallback\nend","preventionTips":["Run Selenium on a mainstream supported OS.","Log RbConfig::CONFIG['host_os'] early in CI to catch detection issues.","Monkey-patch Platform.os only as a last resort on niche systems."],"tags":["ruby","platform","environment","os-detection"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}