{"record":{"id":"bda8414ecb4e986e","repo":"padrino/padrino-framework","slug":"unable-to-locate-source-file-for-app-app-class","errorCode":null,"errorMessage":"Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb'","messagePattern":"Unable to locate source file for app '#(.+?)', try with app_file: '/path/app\\.rb'","errorType":"exception","errorClass":"Padrino::Mounter::MounterException","httpStatus":null,"severity":"error","filePath":"padrino-core/lib/padrino-core/mounter.rb","lineNumber":215,"sourceCode":"      candidates  = []\n      candidates << app_const.app_file if app_const.respond_to?(:app_file)\n      candidates << Padrino.first_caller if File.identical?(Padrino.first_caller.to_s, Padrino.called_from.to_s)\n      candidates << Padrino.mounted_root(name.downcase, 'app.rb')\n\n      simple_name = name.split('::').last.downcase\n      mod_name = name.split('::')[0..-2].join('::')\n\n      Padrino.modules.each { |mod| candidates << mod.root(simple_name, 'app.rb') if mod.name == mod_name }\n      candidates << Padrino.root('app', 'app.rb')\n      candidates.find { |candidate| File.exist?(candidate) }\n    end\n\n    ###\n    # Raises an exception unless app_file is located properly.\n    #\n    def ensure_app_file!\n      message = \"Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb'\"\n      raise MounterException, message unless @app_file\n    end\n\n    ###\n    # Raises an exception unless app_obj is defined properly.\n    #\n    def ensure_app_object!\n      message = \"Unable to locate app for '#{app_class}', try with app_class: 'MyAppClass'\"\n      raise MounterException, message unless @app_obj\n    end\n  end\n\n  class << self\n    attr_writer :mounted_root # Set root directory where padrino searches mounted apps\n\n    ##\n    # @param [Array] args\n    #\n    # @return [String]","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-core/lib/padrino-core/mounter.rb#L197-L233","documentation":"Error \"Unable to locate source file for app '#{app_class}', try with app_file: '/path/app.rb'\" thrown in padrino/padrino-framework.","triggerScenarios":"Thrown at padrino-core/lib/padrino-core/mounter.rb:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}