ruby/rubygems · error · InvalidOption

Unable to remove the platform `#{platform}` since the only p

Error message

Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}

What it means

Error "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/definition.rb:546

        "but your local platform is #{Bundler.local_platform}. " \
        "Add the current platform to the lockfile with\n`bundle lock --add-platform #{Bundler.local_platform}` and try again."
    end

    def normalize_platforms
      resolve.normalize_platforms!(current_dependencies, platforms)

      @resolve = SpecSet.new(resolve.for(current_dependencies, @platforms))
    end

    def add_platform(platform)
      return if @platforms.include?(platform)

      @new_platforms << platform
      @platforms << platform
    end

    def remove_platform(platform)
      raise InvalidOption, "Unable to remove the platform `#{platform}` since the only platforms are #{@platforms.join ", "}" unless @platforms.include?(platform)

      @removed_platforms << platform
      @platforms.delete(platform)
    end

    def nothing_changed?
      !something_changed?
    end

    def no_resolve_needed?
      !resolve_needed?
    end

    def unlocking?
      @unlocking
    end

    def add_checksums

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/definition.rb:546 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/7531e5d3af38cea9. Report an issue: GitHub.