{"record":{"id":"7e32caed84c1eba7","repo":"padrino/padrino-framework","slug":"rack-config-file-config-file-must-have-ru","errorCode":null,"errorMessage":"Rack config file `#{config_file}` must have `.ru` extension","messagePattern":"Rack config file `#(.+?)` must have `\\.ru` extension","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"padrino-core/lib/padrino-core/server.rb","lineNumber":22,"sourceCode":"  # thin, mongrel, or WEBrick in that order.\n  #\n  # @example\n  #   Padrino.run! # with these defaults => host: '127.0.0.1', port: '3000', adapter: the first found\n  #   Padrino.run!('0.0.0.0', '4000', 'mongrel') # use => host: '0.0.0.0', port: '4000', adapter: 'mongrel'\n  #\n  def self.run!(options = {})\n    Padrino.load!\n    Server.start(*detect_application(options))\n  end\n\n  def self.detect_application(options)\n    default_config_file = 'config.ru'\n\n    config_file = options.delete(:config)\n    config_file ||= default_config_file if File.file?(default_config_file)\n    return [Padrino.application, options] unless config_file\n\n    raise \"Rack config file `#{config_file}` must have `.ru` extension\" unless config_file =~ /\\.ru$/\n    rack_app, rack_options = Rack::Builder.parse_file(config_file)\n    [rack_app, (rack_options || {}).merge(options)]\n  end\n\n  ##\n  # This module builds a Padrino server to run the project based on available handlers.\n  #\n  class Server < Rackup::Server\n    DEFAULT_ADDRESS = { Host: '127.0.0.1', Port: 3000 }\n\n    # Server Handlers\n    Handlers = %i[thin puma spider-gazelle mongrel trinidad webrick]\n\n    # Starts the application on the available server with specified options.\n    def self.start(app, options = {})\n      options = Utils.symbolize_keys(options.to_hash)\n      options.update(parse_server_options(options.delete(:options)))\n      options.update(detect_address(options))","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-core/lib/padrino-core/server.rb#L4-L40","documentation":"Error \"Rack config file `#{config_file}` must have `.ru` extension\" thrown in padrino/padrino-framework.","triggerScenarios":"Thrown at padrino-core/lib/padrino-core/server.rb:22 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"}