Topic: Configuring Passenger version of Ruby

Hi,

I've installed ruby 1.9.2 using RVM. My application was still mysteriously loading ruby 1.8.7 (causing syntax errors) so first I attempted to uninstall ruby 1.8.7 using RVM (to no effect) and then just deleted 1.8.7 manually. Now Passenger crashes because it can't find Ruby (not surprising). Where can I find the Passenger config file to manually specify the Ruby location?

I've googled this problem but most suggestions are just a vague "use RVM" which I've already tried.


Here's the server error:
----------------------------------------------------------------------------------------------------------------------------
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750)
     in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:297)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566)

*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby: No such file or directory (2)
[ pid=890 thr=3077855056 file=ext/apache2/Hooks.cpp:865 time=2012-04-08 23:52:00.191 ]: Unexpected error in mod_passenger: Cannot spawn application '/home/asfarley/homepage': Could not read from the spawn server: Connection reset by peer (104)
  Backtrace:
     in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750)
     in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:297)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566)

*** Passenger ERROR (ext/common/ApplicationPool/../SpawnManager.h:220):
Could not start the spawn server: /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby: No such file or directory (2)
[ pid=807 thr=3077855056 file=ext/apache2/Hooks.cpp:865 time=2012-04-08 23:52:52.13 ]: Unexpected error in mod_passenger: Cannot spawn application '/home/asfarley/homepage': Could not read from the spawn server: Connection reset by peer (104)
  Backtrace:
     in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:750)
     in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:297)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:566)

----------------------------------------------------------------------------------------------------------------------------

Also, here's the output of
rvm info
[root@asfarley homepage]# rvm info

ruby-1.9.2-p318@homepage:

  system:
    uname:       "Linux asfarley.com 2.6.32-042stab053.5 #1 SMP Tue Mar 27 11:42:17 MSD 2012 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.1.2(1)-release (i386-redhat-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.11.7 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "1 hour 1 minute 27 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p318"
    date:         "2012-02-14"
    platform:     "i686-linux"
    patchlevel:   "2012-02-14 revision 34678"
    full_version: "ruby 1.9.2p318 (2012-02-14 revision 34678) [i686-linux]"

  homes:
    gem:          "/usr/local/rvm/gems/ruby-1.9.2-p318@homepage"
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.2-p318"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.2-p318/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-1.9.2-p318/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-1.9.2-p318/bin/gem"
    rake:         "/usr/local/rvm/gems/ruby-1.9.2-p318@homepage/bin/rake"

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-1.9.2-p318@homepage/bin:/usr/local/rvm/gems/ruby-1.9.2-p318@global/bin:/usr/local/rvm/rubies/ruby-1.9.2-p318/bin:/usr/local/rvm/bin:/usr/local/bin/ruby:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"
    GEM_HOME:     "/usr/local/rvm/gems/ruby-1.9.2-p318@homepage"
    GEM_PATH:     "/usr/local/rvm/gems/ruby-1.9.2-p318@homepage:/usr/local/rvm/gems/ruby-1.9.2-p318@global"
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.2-p318"
    IRBRC:        "/usr/local/rvm/rubies/ruby-1.9.2-p318/.irbrc"
    RUBYOPT:      ""
    gemset:       "homepage"


[root@asfarley homepage]# ruby -v
ruby 1.9.2p318 (2012-02-14 revision 34678) [i686-linux]
[root@asfarley homepage]# rvm list

rvm rubies

=* ruby-1.9.2-p318 [ i686 ]

# => - current
# =* - current && default
#  * - default

Last edited by asfarley (2012-04-08 16:08:54)

Re: Configuring Passenger version of Ruby

You are using passenger installed with ruby enterprise edition (ree).  I'm not sure,  but I think you'll have to re-install passenger without ree.  At least that's what I remember,  when you don't have passenger with ree , then you can specify the version of ruby that passenger will use,  i.e. in my case

/opt/local/etc/httpd/includes/passenger.conf:

<IfModule mod_passenger.c>
PassengerRoot /home/admin/passenger-3.0.11/share/phusion-passenger/source
PassengerRuby /opt/local/bin/ruby19

PassengerMaxPoolSize 16
PassengerMaxInstancesPerApp 0
PassengerPoolIdleTime 300
</IfModule>

It's been a while,  so maybe just changing this config file will work,  but I remember having to re-build passenger.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.