{"record":{"id":"4395f08c820a2e9d","repo":"ruby/rubygems","slug":"cannot-find-gem-dependencies-file-message","errorCode":null,"errorMessage":"cannot find gem dependencies file #{message}","messagePattern":"cannot find gem dependencies file #(.+?)","errorType":"validation","errorClass":"Gem::OptionParser::InvalidArgument","httpStatus":null,"severity":"error","filePath":"lib/rubygems/install_update_options.rb","lineNumber":158,"sourceCode":"      options[:minimal_deps] = value\n    end\n\n    add_option(:\"Install/Update\", \"--[no-]post-install-message\",\n                \"Print post install message\") do |value, options|\n      options[:post_install_message] = value\n    end\n\n    add_option(:\"Install/Update\", \"-g\", \"--file [FILE]\",\n               \"Read from a gem dependencies API file and\",\n               \"install the listed gems\") do |v,_o|\n      v ||= Gem::GEM_DEP_FILES.find do |file|\n        File.exist? file\n      end\n\n      unless v\n        message = v ? v : \"(tried #{Gem::GEM_DEP_FILES.join \", \"})\"\n\n        raise Gem::OptionParser::InvalidArgument,\n                \"cannot find gem dependencies file #{message}\"\n      end\n\n      options[:gemdeps] = v\n    end\n\n    add_option(:\"Install/Update\", \"--without GROUPS\", Array,\n               \"Omit the named groups (comma separated)\",\n               \"when installing from a gem dependencies\",\n               \"file\") do |v,_o|\n      options[:without_groups].concat v.map(&:intern)\n    end\n\n    add_option(:Deprecated, \"--default\",\n               \"Add the gem's full specification to\",\n               \"specifications/default and extract only its bin\") do |v,_o|\n    end\n","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/install_update_options.rb#L140-L176","documentation":"Error \"cannot find gem dependencies file #{message}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/install_update_options.rb:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an existing dependencies file: `gem install -g /path/to/Gemfile`","Create the Gemfile/gemspec the option points at, or fix the path typo"],"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"}