{"record":{"id":"c4a1fea3052925bf","repo":"jordansissel/fpm","slug":"self-class-name-does-not-yet-support-reading","errorCode":null,"errorMessage":"#{self.class.name} does not yet support reading #{self.type} packages","messagePattern":"#(.+?) does not yet support reading #(.+?) packages","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"lib/fpm/package.rb","lineNumber":245,"sourceCode":"    # nothing to do by default. Subclasses may implement this.\n    # See the RPM package class for an example.\n  end # def converted_from\n\n  # Add a new source to this package.\n  # The exact behavior depends on the kind of package being managed.\n  #\n  # For instance:\n  #\n  # * for FPM::Package::Dir, << expects a path to a directory or files.\n  # * for FPM::Package::RPM, << expects a path to an rpm.\n  #\n  # The idea is that you can keep pumping in new things to a package\n  # for later conversion or output.\n  #\n  # Implementations are expected to put files relevant to the 'input' in the\n  # staging_path\n  def input(thing_to_input)\n    raise NotImplementedError.new(\"#{self.class.name} does not yet support \" \\\n                                  \"reading #{self.type} packages\")\n  end # def input\n\n  # Output this package to the given path.\n  def output(path)\n    raise NotImplementedError.new(\"#{self.class.name} does not yet support \" \\\n                                  \"creating #{self.type} packages\")\n  end # def output\n\n  def staging_path(path=nil)\n    @staging_path ||= Stud::Temporary.directory(\"package-#{type}-staging\")\n\n    if path.nil?\n      return @staging_path\n    else\n      return File.join(@staging_path, path)\n    end\n  end # def staging_path","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package.rb#L227-L263","documentation":"FPM::Package#input is the abstract 'read a package of this type' hook that every format subclass must override. When a format class never implements it (fpm can create that type but cannot consume it), the base method raises NotImplementedError naming the class and type, e.g. 'FPM::Package::Virtualenv does not yet support reading virtualenv packages'. This is a capability gap of the format plugin, not a runtime fault in your package data.","triggerScenarios":"Calling pkg.input(path) on a format class that only implements output, or running 'fpm -s virtualenv -t deb ...' / 'fpm -s pleaserun ...' where the -s type is output-only. Also raised when a custom subclass registered with FPM::Package forgets to define def input.","commonSituations":"Assuming every fpm type is round-trippable and trying to convert FROM an output-only format (virtualenv, pleaserun-style); typos in -s/--input-type that resolve to the wrong registered class; writing custom format plugins and forgetting the reader half.","solutions":["Switch to a readable input type: unpack the artifact and run 'fpm -s dir -t <target> <unpacked-dir>'","Check FPM::Package.types (or 'fpm --help') to confirm the chosen type actually defines input before scripting conversions","If you own the subclass, implement def input(thing) to populate staging_path, or raise your own descriptive error to make the gap explicit"],"exampleFix":"# before\nfpm -s virtualenv -t deb ./myvenv   # => NotImplementedError: ...reading virtualenv packages\n\n# after: package the virtualenv contents as a plain directory tree\nfpm -s dir -t deb ./myvenv","handlingStrategy":"validation","validationCode":"require 'fpm/package'\n\ndef fpm_can_read?(type)\n  klass = FPM::Package.types[type.to_s]\n  !klass.nil? && klass.instance_method(:input).owner != FPM::Package\nend\n\nabort 'fpm cannot read this package type' unless fpm_can_read?('deb')","typeGuard":null,"tryCatchPattern":"begin\n  pkg.input(artifact)\nrescue NotImplementedError => e\n  warn \"#{pkg.class} has no reader (#{e.message}); unpack it and use FPM::Package::Dir instead\"\n  raise\nend","preventionTips":["Verify the -s type actually defines input before scripting conversions (FPM::Package.types + instance_method(:input).owner)","Keep a fallback path: extract artifacts to a directory and package with -s dir","In custom FPM::Package subclasses, always define input (even if it raises your own clearer error)"],"tags":["fpm","ruby","packaging","not-implemented","input-type","conversion"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}