ruby/rubygems · error · Gem::OptionParser::InvalidOption

your platform is not supported

Error message

your platform is not supported

What it means

Error "your platform is not supported" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/install_update_options.rb:66

               "generate.  For example: rdoc,ri") do |value, options|
      options[:document] = case value
                           when nil   then %w[ri]
                           when false then []
                           else value
      end
    end

    add_option(:"Install/Update", "--build-root DIR",
               "Temporary installation root. Useful for building",
               "packages. Do not use this when installing remote gems.") do |value, options|
      options[:build_root] = File.expand_path(value)
    end

    add_option(:"Install/Update", "--vendor",
               "Install gem into the vendor directory.",
               "Only for use by gem repackagers.") do |_value, options|
      unless Gem.vendor_dir
        raise Gem::OptionParser::InvalidOption.new "your platform is not supported"
      end

      options[:vendor] = true
      options[:install_dir] = Gem.vendor_dir
    end

    add_option(:"Install/Update", "-N", "--no-document",
               "Disable documentation generation") do |_value, options|
      options[:document] = []
    end

    add_option(:"Install/Update", "-E", "--[no-]env-shebang",
               "Rewrite the shebang line on installed",
               "scripts to use /usr/bin/env") do |value, options|
      options[:env_shebang] = value
    end

    add_option(:"Install/Update", "-f", "--[no-]force",

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. Install the gem for your platform: `gem install <gem> --platform <platform>`
  2. Use a Ruby build/platform that the gem supports (e.g. avoid mswin-only gems on Linux)

When it happens

Trigger: Thrown at lib/rubygems/install_update_options.rb:66 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/3ad52b63476ec7cb. Report an issue: GitHub.