padrino/padrino-framework · error · TemplateNotFound

Layout '#{template_path}' not found in '#{layouts_path}'

Error message

Layout '#{template_path}' not found in '#{layouts_path}'

What it means

Error "Layout '#{template_path}' not found in '#{layouts_path}'" thrown in padrino/padrino-framework.

Source

Thrown at padrino-helpers/lib/padrino/rendering.rb:326

      end

      ##
      # Return the I18n.locale if I18n is defined.
      #
      def locale
        I18n.locale if defined?(I18n)
      end

      def resolve_layout(layout, options = {})
        layouts_path = options[:layout_options] && options[:layout_options][:views] || options[:views] || settings.views || './views'
        template_path = settings.fetch_layout_path(layout, layouts_path)
        rendering_options = [template_path, content_type || :html, locale]

        settings.cache_template_path(rendering_options) do
          template_candidates = glob_templates(layouts_path, template_path)
          selected_template = select_template(template_candidates, *rendering_options)

          raise TemplateNotFound, "Layout '#{template_path}' not found in '#{layouts_path}'" if !selected_template && layout
          selected_template
        end
      end

      def with_layout(options)
        options = options.dup
        layout = options[:layout]
        return options if layout == false

        layout = @layout if !layout || layout == true
        return options if settings.templates.key?(:layout) && !layout

        if layout.is_a?(String) && Pathname.new(layout).absolute?
          layout_path, _, layout = layout.rpartition('/')
          options[:layout_options] ||= {}
          options[:layout_options][:views] ||= layout_path
        end
        layout, layout_engine = resolve_layout(layout, options)

View on GitHub (pinned to 167044f3d5)

When it happens

Trigger: Thrown at padrino-helpers/lib/padrino/rendering.rb:326 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of padrino/padrino-framework@167044f3d5 (2026-08-23). Data as JSON: /api/errors/07b8744aa26a960b. Report an issue: GitHub.