{"record":{"id":"9594b508be9fd0d2","repo":"ruby/rubygems","slug":"undefined-local-variable-or-method-name-for-g-9594b5","errorCode":null,"errorMessage":"Undefined local variable or method `#{name}' for Gemfile","messagePattern":"Undefined local variable or method `#(.+?)' for Gemfile","errorType":"exception","errorClass":"PluginGemfileError","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin/dsl.rb","lineNumber":34,"sourceCode":"      #\n      # When we encounter :type attribute with a source block, we add a plugin\n      # by name bundler-source-<type> to list of plugins to be installed.\n      #\n      # These plugins are optional and are not installed when there is conflict\n      # with any other plugin.\n      attr_reader :inferred_plugins\n\n      def initialize\n        super\n        @inferred_plugins = [] # The source plugins inferred from :type\n      end\n\n      def gem(*args)\n        # Ignore regular dependencies when doing the plugins-only pre-parse\n      end\n\n      def method_missing(name, *args)\n        raise PluginGemfileError, \"Undefined local variable or method `#{name}' for Gemfile\" unless Bundler::Dsl.method_defined? name\n      end\n\n      def source(source, *args, &blk)\n        options = args.last.is_a?(Hash) ? args.pop.dup : {}\n        options = normalize_hash(options)\n        return super unless options.key?(\"type\")\n\n        plugin_name = \"bundler-source-#{options[\"type\"]}\"\n\n        return if @dependencies.any? {|d| d.name == plugin_name }\n\n        plugin(plugin_name)\n        @inferred_plugins << plugin_name\n      end\n    end\n  end\nend\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin/dsl.rb#L16-L52","documentation":"Error \"Undefined local variable or method `#{name}' for Gemfile\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin/dsl.rb:34 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"}