{"record":{"id":"5c305266bc5dfdc4","repo":"ruby/rubygems","slug":"could-not-locate-gemfile-or-bundle-directory","errorCode":null,"errorMessage":"Could not locate Gemfile or .bundle/ directory","messagePattern":"Could not locate Gemfile or \\.bundle/ directory","errorType":"exception","errorClass":"GemfileNotFound","httpStatus":null,"severity":"error","filePath":"lib/bundler.rb","lineNumber":323,"sourceCode":"\n    def home\n      bundle_path.join(\"bundler\")\n    end\n\n    def install_path\n      home.join(\"gems\")\n    end\n\n    def specs_path\n      bundle_path.join(\"specifications\")\n    end\n\n    def root\n      @root ||= begin\n                  SharedHelpers.root\n                rescue GemfileNotFound\n                  bundle_dir = default_bundle_dir\n                  raise GemfileNotFound, \"Could not locate Gemfile or .bundle/ directory\" unless bundle_dir\n                  Pathname.new(File.expand_path(\"..\", bundle_dir))\n                end\n    end\n\n    def app_config_path\n      if app_config = ENV[\"BUNDLE_APP_CONFIG\"]\n        app_config_pathname = Pathname.new(app_config)\n\n        if app_config_pathname.absolute?\n          app_config_pathname\n        else\n          app_config_pathname.expand_path(root)\n        end\n      else\n        root.join(\".bundle\")\n      end\n    end\n","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler.rb#L305-L341","documentation":"Error \"Could not locate Gemfile or .bundle/ directory\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler.rb:323 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"}