lib/rconf/configurators/passenger_configurator.rb in rconf-0.6.25 vs lib/rconf/configurators/passenger_configurator.rb in rconf-0.6.30
- old
+ new
@@ -38,11 +38,11 @@
# === Return
# true:: Always return true
def run_linux
set_defaults
report_check("Checking for passenger gem #{gem_version}")
- res = Command.execute('gem', 'list', 'passenger')
+ res = Command.execute_in_ruby('gem', 'list', 'passenger')
success = (res.output =~ /^passenger \(#{gem_version}\)$/)
report_result(success)
install_gem unless success
report_check('Checking for passenger+nginx')
res = Command.execute('which', 'nginx').success?
@@ -110,11 +110,11 @@
#
# === Return
# true:: Always return true
def install_gem
report_check('Installing passenger gem')
- Command.execute('gem', 'install', 'passenger', '-v', gem_version,
+ Command.execute_in_ruby('gem', 'install', 'passenger', '-v', gem_version,
:abort_on_failure => "Failed to install passenger gem version #{gem_version}")
report_success
end
# Install passenger+nginx
@@ -124,11 +124,11 @@
def install_passenger
report_check('Installing passenger+nginx')
# Grrrrr passenger installer expect rake where it's not... HACK
ruby_dir = File.dirname(`which ruby`.chomp)
FileUtils.cp(`which rake`.chomp, ruby_dir) unless rake_exist = File.exist?(File.join(ruby_dir, 'rake'))
- Command.execute('passenger-install-nginx-module', '--auto',
+ Command.execute_in_ruby('passenger-install-nginx-module', '--auto',
'--auto-download', '--prefix', install_path,
:abort_on_failure => "Failed to install nginx into #{install_path}")
FileUtils.mkdir_p(File.join(install_path, 'sites-enabled'))
FileUtils.mkdir_p(File.join(install_path, 'logs'))
File.open(File.join(install_path, 'conf', 'nginx.conf'), 'w') { |f| f.puts(nginx_config) }
@@ -171,11 +171,11 @@
# username(String):: Username used to run nginx
#
# === Return
# config(String):: Nginx config
def nginx_config
- ruby_bin = Command.execute('which', 'ruby').output.chomp
- res = Command.execute('ruby', '-e', "require 'rubygems';puts Gem.source_index.find_name('passenger').detect { |g| g.version.to_s == '#{PASSENGER_GEM_VERSION}' }.full_gem_path",
+ ruby_bin = Command.execute_in_ruby('which', 'ruby').output.chomp
+ res = Command.execute_in_ruby('ruby', '-e', "require 'rubygems';puts Gem.source_index.find_name('passenger').detect { |g| g.version.to_s == '#{PASSENGER_GEM_VERSION}' }.full_gem_path",
:abort_on_failure => 'Could not find passenger gem to build passenger_root')
passenger_root = res.output.chomp
report_fatal('Could not find passenger gem') if passenger_root.empty?
<<-EOS
worker_processes 1;