{"record":{"id":"09d9cc30f1c85a17","repo":"padrino/padrino-framework","slug":"gem-padrino-helpers-is-required-to-render-partia","errorCode":null,"errorMessage":"gem 'padrino-helpers' is required to render partials","messagePattern":"gem 'padrino-helpers' is required to render partials","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"padrino-mailer/lib/padrino-mailer/ext.rb","lineNumber":284,"sourceCode":"      if mailer_name && !engine.to_s.index('/')\n        settings.views += \"/#{mailer_name}\" unless settings.views.include?(\"/#{mailer_name}\")\n        engine = engine.to_s.sub(%r{^#{mailer_name}/}, '')\n      end\n\n      provides.each do |format|\n        part do |p|\n          p.content_type(format)\n          p.send(:render, engine, data, options, locals, &block)\n          add_multipart_alternate_header if html_part || provides.include?(:html)\n        end\n      end\n\n      self.body = super(engine, data, options, locals, &block) if provides.empty?\n    end\n\n    alias original_partial partial if instance_methods.include?(:partial)\n    def partial(template, options = {}, &block)\n      raise \"gem 'padrino-helpers' is required to render partials\" unless respond_to?(:original_partial)\n      self.body = original_partial(template, options, &block)\n    end\n\n    ##\n    # Register all special template configurations Padrino has to our fake settings object.\n    #\n    def initialize_template_settings!\n      Padrino::Rendering.engine_configurations.each do |name, value|\n        settings.class.instance_eval { define_method(name) { value } }\n      end\n    end\n  end\nend\n","sourceCodeStart":266,"sourceCodeEnd":298,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-mailer/lib/padrino-mailer/ext.rb#L266-L298","documentation":"padrino-mailer's Ext module redefines partial by aliasing the pre-existing implementation as original_partial; that implementation only exists when padrino-helpers was loaded first. The guard respond_to?(:original_partial) fails when padrino-helpers is absent, so calling partial inside a mail template raises this error pointing at the missing gem.","triggerScenarios":"Calling partial 'user_row' inside a mailer view when the Gemfile contains padrino-mailer but not padrino-helpers; using padrino-mailer standalone with a Sinatra app without the helpers gem; upgrading an app whose partials worked before helpers were extracted.","commonSituations":"Upgrading Padrino 0.13 to 0.14 or later, where rendering helpers moved into the separate padrino-helpers gem; minimal custom stacks that include only the mailer; Sinatra apps adopting padrino-mailer just for its DSL.","solutions":["Add gem 'padrino-helpers' to the Gemfile (same version constraint as padrino-mailer) and run bundle install","If the gem is present but the error persists, require 'padrino-helpers' explicitly in boot.rb so it loads before mailer templates render","If you intentionally ship without padrino-helpers, replace partial calls in mail templates with inline markup or full-path render calls"],"exampleFix":"# before — Gemfile\ngem 'padrino-mailer'\n\n# after — Gemfile\ngem 'padrino-mailer'\ngem 'padrino-helpers'","handlingStrategy":"validation","validationCode":"# fail at boot instead of at the first mail render\nunless defined?(Padrino::Helpers) || Gem.loaded_specs['padrino-helpers']\n  abort 'add gem \"padrino-helpers\" to render partials inside mailers'\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install padrino-helpers whenever mailer templates use partial","Add a CI smoke test that renders every mailer template","After Padrino upgrades, check which helpers moved into separate gems"],"tags":["padrino-mailer","padrino-helpers","partial","missing-gem","upgrade"],"backgroundTag":"missing-gem-dependency","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}