Parent

Class/Module Index [+]

Quicksearch

PhusionPassenger::Standalone::RuntimeInstaller

Installs the Phusion Passenger Standalone runtime by downloading and compiling Nginx, compiling the Phusion Passenger support binaries, and storing the results in the designated directories. This installer is entirely non-interactive.

The following option must be given:

If 'targets' contains :nginx, then you must also specify these options:

If targets contains ':support_binaries', then you must also specify this options:

If targets contains ':ruby', then you must also specify this option:

Other optional options:

Please note that RuntimeInstaller will try to avoid compiling/installing things that don't need to be compiled/installed. This is done by checking whether some key files exist, and concluding that something doesn't need to be compiled/installed if they do. This quick check is of course not perfect; if you want to force a recompilation/reinstall then you should remove nginx_dir and support_dir before starting this installer.

Protected Instance Methods

after_install() click to toggle source
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 209
def after_install
        super
        FileUtils.remove_entry_secure(@working_dir) if @working_dir
        @plugin.call_hook(:runtime_installer_cleanup) if @plugin
end
before_install() click to toggle source
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 201
def before_install
        super
        @plugin.call_hook(:runtime_installer_start, self) if @plugin
        @working_dir = PhusionPassenger::Utils.mktmpdir("passenger.", PlatformInfo.tmpexedir)
        @download_binaries = true if !defined?(@download_binaries)
        @binaries_url_root ||= STANDALONE_BINARIES_URL_ROOT
end
dependencies() click to toggle source
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 85
def dependencies
        specs = [
                'depcheck_specs/compiler_toolchain',
                'depcheck_specs/ruby',
                'depcheck_specs/gems',
                'depcheck_specs/libs',
                'depcheck_specs/utilities'
        ]
        ids = [
                'gcc',
                'g++',
                'gmake',
                'download-tool',
                PlatformInfo.passenger_needs_ruby_dev_header? ? 'ruby-dev' : nil,
                'ruby-openssl',
                'rubygems',
                'rake',
                'rack',
                'libcurl-dev',
                'openssl-dev',
                'zlib-dev',
                'pcre-dev',
                'daemon_controller >= 1.1.0'
        ].compact
        return [specs, ids]
end
run_steps() click to toggle source
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 116
def run_steps
        if @support_dir && @nginx_dir
                show_welcome_screen
        end
        check_dependencies(false) || exit(1)
        check_whether_os_is_broken
        check_whether_system_has_enough_ram
        puts
        
        phase = 1
        total_phases = 0
        
        if binary_support_files_should_be_installed?
                check_whether_we_can_write_to(@support_dir) || exit(1)
                total_phases += 4
        end
        if ruby_extension_should_be_installed?
                check_whether_we_can_write_to(@ruby_dir) || exit(1)
                total_phases += 2
        end
        if nginx_needs_to_be_installed?
                check_whether_we_can_write_to(@nginx_dir) || exit(1)
                total_phases += 4
        end
        
        if binary_support_files_should_be_installed? && should_download_binaries?
                download_and_extract_binary_support_files(@support_dir) do |progress, total|
                        show_progress(progress, total, 1, 1, "Extracting Passenger binaries...")
                end
                puts
                puts
        end
        if ruby_extension_should_be_installed? && should_download_binaries?
                download_and_extract_ruby_extension(@ruby_dir) do |progress, total|
                        show_progress(progress, total, 1, 1, "Extracting Ruby extension...")
                end
                puts
                puts
        end
        if nginx_needs_to_be_installed? && should_download_binaries?
                download_and_extract_nginx_binaries(@nginx_dir) do |progress, total|
                        show_progress(progress, total, 1, 1, "Extracting Nginx binaries...")
                end
                puts
                puts
        end
        
        if nginx_needs_to_be_installed?
                nginx_source_dir = download_and_extract_nginx_sources do |progress, total|
                        show_progress(progress, total, phase, total_phases, "Extracting...")
                end
                phase += 1
                if nginx_source_dir.nil?
                        puts
                        show_possible_solutions_for_download_and_extraction_problems
                        exit(1)
                end
        end
        if ruby_extension_should_be_installed?
                phase += install_ruby_extension do |progress, total, subphase, status_text|
                        show_progress(progress, total, phase + subphase, total_phases, status_text)
                end
        end
        if binary_support_files_should_be_installed?
                install_binary_support_files do |progress, total, subphase, status_text|
                        if subphase == 0
                                show_progress(progress, total, phase, total_phases, status_text)
                        else
                                show_progress(progress, total, phase + 1 .. phase + 3, total_phases, status_text)
                        end
                end
                phase += 4
        end
        if nginx_needs_to_be_installed?
                install_nginx_from_source(nginx_source_dir) do |progress, total, status_text|
                        show_progress(progress, total, phase .. phase + 2, total_phases, status_text)
                end
                phase += 3
        end
        
        puts
        puts "<green><b>All done!</b></green>"
        puts
end
users_guide() click to toggle source
# File lib/phusion_passenger/standalone/runtime_installer.rb, line 112
def users_guide
        return "#{PhusionPassenger.doc_dir}/Users guide Standalone.html"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.