padrino/padrino-framework · error

gem 'tilt' is required

Error message

gem 'tilt' is required

What it means

Error "gem 'tilt' is required" thrown in padrino/padrino-framework.

Source

Thrown at padrino-helpers/lib/padrino-helpers/render_helpers.rb:67

        items.each_with_object(SafeBuffer.new) do |item, html|
          locals[item_name] = item if item
          locals["#{item_name}_counter".to_sym] = counter += 1 if counter
          content =
            if block_given?
              concat_content(render(explicit_engine, template_path, options, locals) { capture_html(&block) })
            else
              render(explicit_engine, template_path, options, locals)
            end
          html.safe_concat content if content
        end
      end
      alias render_partial partial

      def self.included(base)
        return if base.instance_methods.include?(:render) || base.private_instance_methods.include?(:render)

        base.class_eval do
          raise "gem 'tilt' is required" unless defined?(::Tilt)

          def render(engine, file = nil, options = {}, locals = nil, &block)
            options.delete(:layout)
            engine, file = file, engine if file.nil?
            template_engine = engine ? ::Tilt[engine] : ::Tilt.default_mapping[file]
            raise "Engine #{engine.inspect} is not registered with Tilt" unless template_engine
            unless File.file?(file.to_s)
              engine_extensions = ::Tilt.default_mapping.extensions_for(template_engine)
              file = Dir.glob("#{file}.{#{engine_extensions.join(',')}}").first || raise("Template '#{file}' not found")
            end
            template = template_engine.new(file.to_s, options)
            template.render(options[:scope] || self, locals, &block)
          end
        end
      end
    end
  end
end

View on GitHub (pinned to 167044f3d5)

When it happens

Trigger: Thrown at padrino-helpers/lib/padrino-helpers/render_helpers.rb:67 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/6b2ed88b26378423. Report an issue: GitHub.