padrino/padrino-framework · error · SystemExit
<= You are using '#{tmp_ext}' and for admin we only support
Error message
<= You are using '#{tmp_ext}' and for admin we only support '#{supported_ext.join(', ')}'. Please use #{supported_ext.map { |ext| "-e #{ext}" }.join(' or ')} What it means
The same generator guard for the rendering engine: the admin generator only emits haml, slim or erb templates (Actions#supported_ext). tmp_ext comes from the -e/--renderer option or, when omitted, from the project's renderer component choice; if neither is in the list, it prints this notice and raises SystemExit without generating anything.
Source
Thrown at padrino-admin/lib/padrino-admin/generators/admin_app.rb:51
class_option :destroy, type: :boolean, aliases: '-d', default: false
class_option :renderer, type: :string, aliases: '-e', desc: 'Rendering engine (erb, haml, slim)'
class_option :admin_model, type: :string, aliases: '-m', default: 'Account', desc: 'The name of model for access controlling'
class_option :admin_name, type: :string, aliases: '-a', default: 'admin', desc: 'The admin application name and path'
# class_option :models_path, desc: 'The models destination path', default: '.', type: :string
# Copies over the Padrino base admin application.
def create_admin
self.destination_root = options[:root]
if in_app_root?
unless supported_orm.include?(orm)
say "<= At the moment, Padrino only supports #{supported_orm.join(' or ')}. Sorry!", :yellow
raise SystemExit
end
tmp_ext = options[:renderer] || fetch_component_choice(:renderer)
unless supported_ext.include?(tmp_ext.to_sym)
say "<= You are using '#{tmp_ext}' and for admin we only support '#{supported_ext.join(', ')}'. Please use #{supported_ext.map { |ext| "-e #{ext}" }.join(' or ')}", :yellow
raise SystemExit
end
# Get the app's namespace.
@app_name = fetch_app_name
# setup admin app name
@admin_name = options[:admin_name].classify
@admin_path = options[:admin_name].underscore
store_component_choice(:admin_renderer, tmp_ext)
self.behavior = :revoke if options[:destroy]
empty_directory destination_root(@admin_path)
# Setup Admin Model
@model_name = options[:admin_model].classify
@model_singular = @model_name.underscoreView on GitHub (pinned to 167044f3d5)
Solutions
- Pass an explicitly supported renderer: `padrino g admin -e erb` (or haml/slim)
- Or change the project's renderer component in .components to haml/slim/erb and re-run without -e
- Verify .components has a valid renderer: line before generating
Example fix
# before bundle exec padrino g admin -e liquid # after bundle exec padrino g admin -e erb
Defensive patterns
Strategy: validation
Validate before calling
renderer = (options[:renderer] || File.read('.components')[/^renderer:\s*(.+)/, 1]).to_s.strip.to_sym
abort "admin supports haml/slim/erb, got #{renderer}" unless %i[haml slim erb].include?(renderer) Type guard
def admin_supported_renderer?(ext) = %i[haml slim erb].include?(ext.to_sym)
Try / catch
begin Padrino::Generators::AdminApp.start(['-e', 'erb']) rescue SystemExit # unsupported renderer — pass -e haml/slim/erb explicitly end
Prevention
- Always pass -e haml|slim|erb to `padrino g admin` when the project uses a less common engine
- Validate the renderer line in .components before scripting generator calls
- Prefer scripting generators with explicit flags over relying on ambient component choices
When it happens
Trigger: `padrino g admin -e liquid` (or any engine outside haml/slim/erb); running the generator in a project whose .components renderer is unsupported; a blank renderer component so tmp_ext.to_sym misses the list.
Common situations: Apps generated with a template engine the project generator permits but the admin generator does not (liquid, erubis, etc.); passing a wrong -e value; hand-edited .components with an empty renderer line.
Related errors
- <= At the moment, Padrino only supports #{supported_orm.join
- Model '#{klass_name}' could not be found! Perhaps you would
- Adapter #{orm} is not yet supported!
- Popover requires tooltip.js
- Role #{role} must be present and must be a symbol!
AI-assisted analysis of padrino/padrino-framework@167044f3d5 (2026-08-23).
Data as JSON: /api/errors/0d26bbbbe4be7388.
Report an issue: GitHub.