{"record":{"id":"57c1d6c542bee44e","repo":"nesquena/rabl","slug":"cannot-find-rabl-template-file-within-registe","errorCode":null,"errorMessage":"Cannot find rabl template '#{file}' within registered (#{view_paths.map(&:to_s).inspect}) view paths!","messagePattern":"Cannot find rabl template '#(.+?)' within registered \\(#(.+?)\\) view paths!","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/rabl/sources.rb","lineNumber":26,"sourceCode":"      custom_view_path = Array(options[:view_path])\n\n      Rabl.source_cache(file, custom_view_path) do\n        view_paths = custom_view_path + Array(Rabl.configuration.view_paths)\n\n        file_path = \\\n          if defined?(Padrino) && context_scope.respond_to?(:settings) && context_scope.respond_to?(:resolve_template)\n            fetch_padrino_source(file, options)\n          elsif defined?(Rails) && context_scope.respond_to?(:view_paths)\n            _view_paths = view_paths + Array(context_scope.view_paths.to_a)\n            fetch_rails_source(file, options) || fetch_manual_template(_view_paths, file)\n          elsif defined?(Sinatra) && context_scope.respond_to?(:settings) && context_scope.settings.respond_to?(:views)\n            fetch_sinatra_source(file, options)\n          else # generic template resolution\n            fetch_manual_template(view_paths, file)\n          end\n\n        unless File.exist?(file_path.to_s)\n          raise \"Cannot find rabl template '#{file}' within registered (#{view_paths.map(&:to_s).inspect}) view paths!\"\n        end\n\n        [File.read(file_path.to_s), file_path.to_s]\n      end\n    end\n\n    private\n      # Returns the rabl template path for padrino views using configured views\n      def fetch_padrino_source(file, options = {})\n        view_path = Array(options[:view_path] || context_scope.settings.views)\n\n        # use Padrino's own template resolution mechanism\n        file_path, _ = context_scope.instance_eval { resolve_template(file) }\n\n        # Padrino chops the extension, stitch it back on\n        File.join(view_path.first.to_s, (file_path.to_s + \".rabl\"))\n      end\n","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/nesquena/rabl/blob/9a16f842adc76ffd89cf5e8cebe93d6939db9f8d/lib/rabl/sources.rb#L8-L44","documentation":"Error \"Cannot find rabl template '#{file}' within registered (#{view_paths.map(&:to_s).inspect}) view paths!\" thrown in nesquena/rabl.","triggerScenarios":"Thrown at lib/rabl/sources.rb:26 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":"9a16f842adc76ffd89cf5e8cebe93d6939db9f8d","analyzedAt":"2026-08-23T09:17:50.891Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}