    # File lib/phusion_passenger/spawn_manager.rb, line 120
            def spawn_application(options)
                    if !options["app_root"]
                            raise ArgumentError, "The 'app_root' option must be given."
                    end
                    options = sanitize_spawn_options(options)

                    case options["app_type"]
                    when "rails"
                            if !defined?(ClassicRails::FrameworkSpawner)
                                    require 'phusion_passenger/classic_rails/framework_spawner'
                                    require 'phusion_passenger/classic_rails/application_spawner'
                            end
                            return spawn_rails_application(options)
                    when "rack"
                            if !defined?(Rack::ApplicationSpawner)
                                    require 'phusion_passenger/rack/application_spawner'
                            end
                            return spawn_rack_application(options)
                    when "wsgi"
                            if !defined?(WSGI::ApplicationSpawner)
                                    require 'phusion_passenger/wsgi/application_spawner'
                            end
                            return WSGI::ApplicationSpawner.spawn_application(options)
                    else
                            raise ArgumentError, "Unknown 'app_type' value '#{options["app_type"]}'."
                    end
            end