    # File lib/phusion_passenger/utils.rb, line 806
            def sanitize_spawn_options(options)
                    defaults = {
                            "app_type"         => "rails",
                            "environment"      => "production",
                            "spawn_method"     => "smart-lv2",
                            "framework_spawner_timeout" => -1,
                            "app_spawner_timeout"       => -1,
                            "print_exceptions" => true
                    }
                    options = defaults.merge(options)
                    options["app_group_name"]            = options["app_root"] if !options["app_group_name"]
                    options["framework_spawner_timeout"] = options["framework_spawner_timeout"].to_i
                    options["app_spawner_timeout"]       = options["app_spawner_timeout"].to_i
                    if options.has_key?("print_framework_loading_exceptions")
                            options["print_framework_loading_exceptions"] = to_boolean(options["print_framework_loading_exceptions"])
                    end
                    # Force this to be a boolean for easy use with Utils#unmarshal_and_raise_errors.
                    options["print_exceptions"]          = to_boolean(options["print_exceptions"])

                    options["analytics"]                 = to_boolean(options["analytics"])
                    options["show_version_in_header"]    = to_boolean(options["show_version_in_header"])

                    # Smart spawning is not supported when using ruby-debug.
                    options["debugger"]     = to_boolean(options["debugger"])
                    options["spawn_method"] = "conservative" if options["debugger"]

                    return options
            end