lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb in rubber-1.11.0 vs lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb in rubber-1.12.0
- old
+ new
@@ -7,11 +7,17 @@
after "rubber:install_gems", "rubber:passenger:custom_install"
task :custom_install, :roles => :passenger do
rubber.sudo_script 'install_passenger', <<-ENDSCRIPT
- if [[ -z `ls #{rubber_env.passenger_lib} 2> /dev/null` ]]; then
+ # can't use passenger_lib from rubber here as it only evaluates correctly
+ # when variable interpolation of rvm_gem_home is run remotely, and since we
+ # are in cap, we run the interpolation locally
+ #
+ passenger_lib=$(find /usr/local/rvm -path "*/passenger-#{rubber_env.passenger_version}/*/mod_passenger.so" 2> /dev/null)
+ if [[ -z $passenger_lib ]]; then
echo -en "\n\n\n\n" | passenger-install-apache2-module
+ rvm #{rubber_env.rvm_ruby} --passenger
fi
ENDSCRIPT
end
after "rubber:setup_app_permissions", "rubber:passenger:setup_passenger_permissions"