ruby/rubygems · error · InvalidOption

There are no gemspecs at #{expanded_path}

Error message

There are no gemspecs at #{expanded_path}

What it means

Error "There are no gemspecs at #{expanded_path}" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/dsl.rb:91

      gemspecs.reject! {|s| s.name != name } if name
      specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] }

      case specs_by_name_and_version.size
      when 1
        specs = specs_by_name_and_version.values.first
        spec = specs.find {|s| s.installable_on_platform?(Bundler.local_platform) } || specs.first

        @gemspecs << spec

        path path, "glob" => glob, "name" => spec.name, "gemspec" => spec do
          add_dependency spec.name
        end

        spec.development_dependencies.each do |dep|
          add_dependency dep.name, dep.requirement.as_list, "gemspec_dev_dep" => true, "group" => development_group
        end
      when 0
        raise InvalidOption, "There are no gemspecs at #{expanded_path}"
      else
        raise InvalidOption, "There are multiple gemspecs at #{expanded_path}. " \
          "Please use the :name option to specify which one should be used"
      end
    end

    def gem(name, *args)
      options = args.last.is_a?(Hash) ? args.pop.dup : {}
      version = args || [">= 0"]

      normalize_options(name, version, options)

      add_dependency(name, version, options)
    end

    # For usage in Dsl.evaluate, since lockfile is used as part of the Gemfile.
    def lockfile_path
      @lockfile

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/dsl.rb:91 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/d433870371f6816e. Report an issue: GitHub.