Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rvm::passenger::apache fails for ubuntu 12.04 / ruby-2.0.0-p195 / passenger 4.0.2 #77

Open
flipkick opened this issue May 15, 2013 · 5 comments

Comments

@flipkick
Copy link

Using this as node config for a ubuntu 12.04 system;

rvm_system_ruby {
  'ruby-2.0.0-p195':
  ensure => 'present',
  default_use => true;
}

class {
  'rvm::passenger::apache':
    version => "4.0.2",
    ruby_version => "ruby-2.0.0-p195",
    mininstances => 3,
    maxinstancesperapp => 0,
    maxpoolsize => 30,
    spawnmethod => "smart-lv2";
}

fails with this exception on the node:

Notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]/returns:  * Checking for Zlib development headers...
Notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]/returns:       Found: yes
Notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]/returns:       Location: /usr/include/zlib.h
Notice: /Stage[main]/Rvm::Passenger::Apache::Ubuntu::Post/Exec[passenger-install-apache2-module]/returns: /usr/local/rvm/gems/ruby-2.0.0-p195/gems/passenger-4.0.2/lib/phusion_passenger/platform_info/ruby.rb:195:in `expand_path': non-absolute home (ArgumentError)
@nlsrchtr
Copy link

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.

@adamcohen
Copy link

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/" 
}

@nlsrchtr
Copy link

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.

@adamcohen
Copy link

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.

@evilensky
Copy link

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']];
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants