Open flipkick opened 11 years ago
Same here. But logging into the machine and running the passenger install command manually fixes it.
I'm running debian 6, ruby-1.9.3-p429, passenger-3.0.21 inside vagrant.
I had this same issue on CentOS 6.4. Turns out it's caused by having an empty HOME environment variable. I fixed it using the following:
Exec {
environment => "HOME=/home/vagrant/"
}
Running the command manually works without any problems:
/usr/local/rvm/bin/rvm ruby-1.9.3-p429 exec passenger-install-apache2-module -a
Would be great if there would be a fix without managing the environment variables.
I'm guessing it works when you run the command manually because you've logged in with an interactive shell that has $HOME set correctly.
I believe the issue is caused by this pull request: (#5224) Unset USER-related env vars during execs
The fix would be for phusion passenger to be careful about using File.expand_path with "~/.rvm" if the HOME environment variable hasn't been set. I don't think there's much we can do in this puppet rvm module to rectify this, other than my suggestion of setting the HOME environment variable in an Exec command as above.
We can hack around it via su -c
exec {
'passenger-install-apache2-module':
command => "/bin/su - root -c \'${rvm::passenger::apache::binpath}rvm ${rvm::passenger::apache::ruby_version} exec passenger-install-apache2-module -a\'",
creates => "${rvm::passenger::apache::gempath}/passenger-${rvm::passenger::apache::version}/ext/apache2/mod_passenger.so",
logoutput => 'on_failure',
require => [Rvm_gem['passenger'], Package['httpd','httpd-devel','mod_ssl']];
}
Using this as node config for a ubuntu 12.04 system;
fails with this exception on the node: