padrino/padrino-framework · error · SystemExit

<= At the moment, Padrino only supports #{supported_orm.join

Error message

<= At the moment, Padrino only supports #{supported_orm.join(' or ')}. Sorry!

What it means

The admin generator (padrino-gen admin) aborts unless the project's ORM component is one of minirecord, activerecord, mongoid, sequel, ohm or dynamoid (Padrino::Generators::Admin::Actions#supported_orm). It prints this yellow notice with say and then raises SystemExit, so nothing is generated. Notably DataMapper — supported by older Padrino versions — is rejected here.

Source

Thrown at padrino-admin/lib/padrino-admin/generators/admin_app.rb:45

      end

      desc "Description:\n\n\tpadrino-gen admin generates a new Padrino Admin application"

      class_option :skip_migration, type: :boolean, aliases: '-s', default: false
      class_option :root,           type: :string,  aliases: '-r', default: '.',       desc: 'The root destination'
      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]

View on GitHub (pinned to 167044f3d5)

Solutions

  1. Edit .components at the project root and switch the orm line to a supported value (activerecord is the safest), then re-run `padrino g admin`
  2. Fix typos — the value must be exactly one of minirecord/activerecord/mongoid/sequel/ohm/dynamoid
  3. If you must keep the unsupported ORM, build the admin section by hand or use another admin layer — this generator cannot emit code for it

Example fix

# .components before
orm: datamapper

# .components after
orm: activerecord
# then: bundle exec padrino g admin
Defensive patterns

Strategy: validation

Validate before calling

supported = %i[minirecord activerecord mongoid sequel ohm dynamoid]
choice = File.read('.components')[/^orm:\s*(.+)/, 1].to_s.strip.to_sym
abort "unsupported orm #{choice}; admin needs one of #{supported.join('/')}" unless supported.include?(choice)

Type guard

def admin_supported_orm?(orm) = %i[minirecord activerecord mongoid sequel ohm dynamoid].include?(orm.to_sym)

Try / catch

begin
  Padrino::Generators::AdminApp.start([])
rescue SystemExit
  # generator printed the yellow notice and aborted; fix .components first
end

Prevention

When it happens

Trigger: Running `padrino g admin` in an app whose .components selects an unsupported orm (datamapper, or a typo like datamaper); generating the project with `padrino-gen project myapp -d datamapper` and then asking for an admin section.

Common situations: Upgrading a legacy DataMapper app to a Padrino version that dropped admin support for it; hand-edited .components with a typo; choosing an ORM the project generator offers but the admin generator does not.

Related errors


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