padrino/padrino-framework · error · Padrino::Mounter::MounterException
Unable to locate source file for app '#{app_class}', try wit
Error message
Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb' What it means
Error "Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb'" thrown in padrino/padrino-framework.
Source
Thrown at padrino-core/lib/padrino-core/mounter.rb:215
candidates = []
candidates << app_const.app_file if app_const.respond_to?(:app_file)
candidates << Padrino.first_caller if File.identical?(Padrino.first_caller.to_s, Padrino.called_from.to_s)
candidates << Padrino.mounted_root(name.downcase, 'app.rb')
simple_name = name.split('::').last.downcase
mod_name = name.split('::')[0..-2].join('::')
Padrino.modules.each { |mod| candidates << mod.root(simple_name, 'app.rb') if mod.name == mod_name }
candidates << Padrino.root('app', 'app.rb')
candidates.find { |candidate| File.exist?(candidate) }
end
###
# Raises an exception unless app_file is located properly.
#
def ensure_app_file!
message = "Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb'"
raise MounterException, message unless @app_file
end
###
# Raises an exception unless app_obj is defined properly.
#
def ensure_app_object!
message = "Unable to locate app for '#{app_class}', try with app_class: 'MyAppClass'"
raise MounterException, message unless @app_obj
end
end
class << self
attr_writer :mounted_root # Set root directory where padrino searches mounted apps
##
# @param [Array] args
#
# @return [String]View on GitHub (pinned to 167044f3d5)
When it happens
Trigger: Thrown at padrino-core/lib/padrino-core/mounter.rb:215 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/bda8414ecb4e986e.
Report an issue: GitHub.