{"record":{"id":"cc809a21fa3a8bd5","repo":"chocolatey/choco","slug":"this-source-is-not-supported-on-non-windows-system-cc809a","errorCode":null,"errorMessage":"This source is not supported on non-Windows systems","messagePattern":"This source is not supported on non-Windows systems","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/RubyGemsService.cs","lineNumber":121,"sourceCode":"\r\n            args.Add(\"Version\", new ExternalCommandArgument\r\n            {\r\n                ArgumentOption = \"--version \",\r\n                QuoteValue = false,\r\n                Required = false\r\n            });\r\n        }\r\n\r\n        public string SourceType\r\n        {\r\n            get { return SourceTypes.Ruby; }\r\n        }\r\n\r\n        public void EnsureSourceAppInstalled(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> ensureAction)\r\n        {\r\n            if (Platform.GetPlatform() != PlatformType.Windows)\r\n            {\r\n                throw new NotImplementedException(\"This source is not supported on non-Windows systems\");\r\n            }\r\n\r\n            var runnerConfig = new ChocolateyConfiguration\r\n            {\r\n                PackageNames = RubyPortalPackage,\r\n                Sources = ApplicationParameters.PackagesLocation,\r\n                Debug = config.Debug,\r\n                Force = config.Force,\r\n                Verbose = config.Verbose,\r\n                CommandExecutionTimeoutSeconds = config.CommandExecutionTimeoutSeconds,\r\n                CacheLocation = config.CacheLocation,\r\n                RegularOutput = config.RegularOutput,\r\n                PromptForConfirmation = false,\r\n                AcceptLicense = true,\r\n                QuietOutput = true,\r\n            };\r\n            runnerConfig.ListCommand.LocalOnly = true;\r\n\r","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/RubyGemsService.cs#L103-L139","documentation":"RubyGemsService.EnsureSourceAppRegistered throws NotImplementedException on non-Windows platforms. The Ruby (gem) source type is supported only on Windows, so initialization fails fast elsewhere.","triggerScenarios":"Using the Ruby source (--source ruby / SourceTypes.Ruby) on Linux or macOS where Platform.GetPlatform() != PlatformType.Windows, when the source is ensured/initialized.","commonSituations":"Running Chocolatey CLI on non-Windows to manage gems; cross-platform scripts assuming Windows; CI matrix with non-Windows nodes.","solutions":["Run Ruby-source commands on a Windows host only","Manage gems with the gem CLI directly on non-Windows systems","Guard Ruby-source commands on platform before invoking them"],"exampleFix":"// before\nchoco install rails --source=ruby  # on Linux\n// after\n# on non-Windows, use gem directly:\ngem install rails","handlingStrategy":"type-guard","validationCode":"if (Platform.GetPlatform() != PlatformType.Windows) {\n    Console.Error.WriteLine(\"Ruby source is Windows-only; use gem directly.\");\n    return;\n}","typeGuard":"static bool IsRubySourceSupported() => Platform.GetPlatform() == PlatformType.Windows;","tryCatchPattern":null,"preventionTips":["Gate Ruby-source commands behind a Windows platform check","Do not include the ruby source in cross-platform scripts","Use gem directly to manage gems on Linux/macOS"],"tags":["platform","ruby","cross-platform"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}