chocolatey/choco · error · NotImplementedException

Alternative sources do not allow the use of the 'all' packag

Error message

Alternative sources do not allow the use of the 'all' package name/keyword.

What it means

RubyGemsService.Install rejects the 'all' keyword: alternative sources cannot install all packages. If config.PackageNames equals ApplicationParameters.AllPackages it throws NotImplementedException before building arguments or running gem.

Source

Thrown at src/chocolatey/infrastructure.app/services/RubyGemsService.cs:216

        }

        public void InstallDryRun(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            var args = ExternalCommandArgsBuilder.BuildArguments(config, _installArguments);
            args = args.Replace(PackageNameToken, config.PackageNames.Replace(';', ','));
            this.Log().Info("Would have run '{0} {1}'".FormatWith(ExePath.EscapeCurlyBraces(), args.EscapeCurlyBraces()));
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction)
        {
            return Install(config, continueAction, beforeModifyAction: null);
        }

        public ConcurrentDictionary<string, PackageResult> Install(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> continueAction, Action<PackageResult, ChocolateyConfiguration> beforeModifyAction)
        {
            if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))
            {
                throw new NotImplementedException("Alternative sources do not allow the use of the 'all' package name/keyword.");
            }

            var packageResults = new ConcurrentDictionary<string, PackageResult>(StringComparer.InvariantCultureIgnoreCase);
            var args = ExternalCommandArgsBuilder.BuildArguments(config, _installArguments);

            foreach (var packageToInstall in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries))
            {
                var argsForPackage = args.Replace(PackageNameToken, packageToInstall);
                var exitCode = _commandExecutor.Execute(
                    ExePath,
                    argsForPackage,
                    config.CommandExecutionTimeoutSeconds,
                    (s, e) =>
                        {
                            var logMessage = e.Data;
                            if (string.IsNullOrWhiteSpace(logMessage))
                            {
                                return;

View on GitHub (pinned to 0d5abdd10c)

Solutions

  1. Install explicit gem names with the Ruby source
  2. Never pass 'all' to alternative sources
  3. Loop over a gem list in your script instead of using 'all'

Example fix

// before
choco install all --source=ruby
// after
choco install rails sinatra --source=ruby
Defensive patterns

Strategy: validation

Validate before calling

if (config.PackageNames == ApplicationParameters.AllPackages) {
    throw new ArgumentException("The Ruby source does not support 'all'; pass explicit gem names.");
}

Try / catch

try { rubyService.Install(config); }
catch (NotImplementedException ex) when (ex.Message.Contains("'all'")) {
    logger.Error(ex.Message); // pass explicit names
}

Prevention

When it happens

Trigger: Calling choco install with PackageNames == 'all' against the Ruby source (SourceTypes.Ruby).

Common situations: Reusing 'all' from a NuGet-style install against the gem source; scripted bulk install that does not apply to alternative sources.

Related errors


AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13). Data as JSON: /api/errors/450c984578487e43. Report an issue: GitHub.