Class: PhusionPassenger::Standalone::RuntimeInstaller

Inherits:
AbstractInstaller show all
Includes:
Utils
Defined in:
lib/phusion_passenger/standalone/runtime_installer.rb

Overview

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

The following option must be given:

  • targets: An array containing at least one of:

    • :support_binaries - to indicate that you want to install the

      Phusion Passenger support binary files.
      
    • :nginx - to indicate that you want to install Nginx.

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

  • support_dir: The support binary files will be installed here.

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

  • nginx_dir: Nginx will be installed into this directory.

  • lib_dir: Path to the Phusion Passenger libraries, which Nginx will link to.

    This may be the same path as `support_dir`; Nginx will be compiled
    after the support binary files are installed.
    
  • nginx_version (optional): The Nginx version to download. If not given then a hardcoded version number will be used.

  • nginx_tarball (optional): The location to the Nginx tarball. This tarball must contain the Nginx version as specified by version. If tarball is given then Nginx will not be downloaded; it will be extracted from this tarball instead.

Other optional options:

  • download_binaries: If true then RuntimeInstaller will attempt to download a precompiled Nginx binary and precompiled Phusion Passenger support binaries from the network, if they exist for the current platform. The default is true. Note that binary downloading only happens when Phusion Passenger is installed from an official release package.

  • binaries_url_root: The URL on which to look for the aforementioned binaries. The default points to the Phusion website.

Constant Summary

Constants inherited from AbstractInstaller

AbstractInstaller::PASSENGER_WEBSITE, AbstractInstaller::PHUSION_WEBSITE

Instance Method Summary collapse

Methods inherited from AbstractInstaller

#run

Constructor Details

#initialize(*args) ⇒ RuntimeInstaller

Returns a new instance of RuntimeInstaller.

Raises:

  • (ArgumentError)


76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/phusion_passenger/standalone/runtime_installer.rb', line 76

def initialize(*args)
	super(*args)
	raise ArgumentError, "At least one target must be given" if @targets.nil? || @targets.empty?
	if @targets.include?(:support_binaries)
		if PhusionPassenger.natively_packaged?
			raise ArgumentError, "You cannot specify :support_binaries as a " +
				"target when natively packaged"
		end
		raise ArgumentError, ":support_dir must be given" if !@support_dir
	end
	if @targets.include?(:nginx)
		raise ArgumentError, ":nginx_dir must be given" if !@nginx_dir
		raise ArgumentError, ":lib_dir must be given" if !@lib_dir
	end
end