ruby/rubygems · error · InvalidOption

--normalize-platforms can't be used with --add-platform

Error message

--normalize-platforms can't be used with --add-platform

What it means

Error "--normalize-platforms can't be used with --add-platform" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/cli/lock.rb:94

        else
          file = options[:lockfile]
          file = file ? Pathname.new(file).expand_path : Bundler.default_lockfile

          puts "Writing lockfile to #{file}"
          definition.write_lock(file, false)
        end

        Bundler::CLI::Common.output_cooldown_skipped_summary(definition)
      end

      Bundler.ui.output_stream = previous_output_stream
    end

    private

    def check_for_conflicting_options
      if options["normalize-platforms"] && options["add-platform"].any?
        raise InvalidOption, "--normalize-platforms can't be used with --add-platform"
      end

      if options["normalize-platforms"] && options["remove-platform"].any?
        raise InvalidOption, "--normalize-platforms can't be used with --remove-platform"
      end
    end
  end
end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/cli/lock.rb:94 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/8a98680dc09c3b53. Report an issue: GitHub.