{"record":{"id":"2d205b1e99c4b5a4","repo":"ruby/rubygems","slug":"there-was-an-error-while-loading-path-basename","errorCode":null,"errorMessage":"There was an error while loading `#{path.basename}`: #{e.message}","messagePattern":"There was an error while loading `#(.+?)`: #(.+?)","errorType":"exception","errorClass":"GemspecError","httpStatus":null,"severity":"error","filePath":"lib/bundler.rb","lineNumber":657,"sourceCode":"      Kernel.require \"psych\"\n\n      Gem::Specification.from_yaml(contents)\n    end\n\n    def eval_gemspec(path, contents)\n      if contents.start_with?(\"---\") # YAML header\n        eval_yaml_gemspec(path, contents)\n      else\n        # Eval the gemspec from its parent directory, because some gemspecs\n        # depend on \"./\" relative paths.\n        SharedHelpers.chdir(path.dirname.to_s) do\n          eval(contents, TOPLEVEL_BINDING.dup, path.expand_path.to_s)\n        end\n      end\n    rescue ScriptError, StandardError => e\n      msg = \"There was an error while loading `#{path.basename}`: #{e.message}\"\n\n      raise GemspecError, Dsl::DSLError.new(msg, path.to_s, e.backtrace, contents)\n    end\n\n    def configure_gem_path\n      unless use_system_gems?\n        # this needs to be empty string to cause\n        # PathSupport.split_gem_path to only load up the\n        # Bundler --path setting as the GEM_PATH.\n        Bundler::SharedHelpers.set_env \"GEM_PATH\", \"\"\n      end\n    end\n\n    def configure_gem_home(path)\n      Bundler::SharedHelpers.set_env \"GEM_HOME\", path.to_s\n    end\n\n    def tmp_home_path\n      Kernel.send(:require, \"tmpdir\")\n      SharedHelpers.filesystem_access(Dir.tmpdir) do","sourceCodeStart":639,"sourceCodeEnd":675,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler.rb#L639-L675","documentation":"Error \"There was an error while loading `#{path.basename}`: #{e.message}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler.rb:657 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}