{"record":{"id":"2f1216ad9e283034","repo":"jordansissel/fpm","slug":"self-class-name-does-not-yet-support-creating","errorCode":null,"errorMessage":"#{self.class.name} does not yet support creating #{self.type} packages","messagePattern":"#(.+?) does not yet support creating #(.+?) packages","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"lib/fpm/package.rb","lineNumber":251,"sourceCode":"  #\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\n\n  def build_path(path=nil)\n    @build_path ||= Stud::Temporary.directory(\"package-#{type}-build\")\n\n    if path.nil?\n      return @build_path","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package.rb#L233-L269","documentation":"FPM::Package#output is the abstract 'write a package of this type' hook. If a format subclass only implements input (fpm can read that type but cannot create it), the base method raises NotImplementedError, e.g. 'FPM::Package::Cpan does not yet support creating cpan packages'. It fails before any file is written, as a hard stop on unsupported conversions.","triggerScenarios":"Running 'fpm -s <src> -t cpan', '-t npm', or '-t python' (formats that implement input only), or calling pkg.output(path) on such a class; also custom subclasses missing def output.","commonSituations":"Trying to produce an npm/cpan/python package with fpm (those formats are input-only today); copying example commands from docs that assume a bidirectional type; custom plugin development where only the reader was written.","solutions":["Choose an output type fpm can create (deb, rpm, apk, tar, dir, pkg, ...); for language ecosystems use their native build tool (npm pack, python -m build) instead of fpm","Verify with FPM::Package.types that the target class overrides output before building automation around it","In custom subclasses, implement def output(path) or raise your own clearer error"],"exampleFix":"# before\nfpm -s dir -t npm ./app   # => NotImplementedError: ...creating npm packages\n\n# after: build the npm tarball with npm itself, or emit a format fpm supports\nfpm -s dir -t tar ./app","handlingStrategy":"validation","validationCode":"require 'fpm/package'\n\ndef fpm_can_write?(type)\n  klass = FPM::Package.types[type.to_s]\n  !klass.nil? && klass.instance_method(:output).owner != FPM::Package\nend\n\nabort 'fpm cannot create this package type' unless fpm_can_write?('rpm')","typeGuard":null,"tryCatchPattern":"begin\n  pkg.output(path)\nrescue NotImplementedError => e\n  warn \"#{pkg.class} cannot be created by fpm (#{e.message}); pick a supported -t target\"\n  raise\nend","preventionTips":["Check instance_method(:output).owner on the target class before choosing -t","For language-ecosystem formats (npm, cpan, python), prefer their native build tools over fpm output","Encode the supported -s/-t matrix in your build tooling so unsupported pairs fail with your own message"],"tags":["fpm","ruby","packaging","not-implemented","output-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"}