12

I tried changing the default ruby command to 1.9.2 but Passenger keeps running 1.8.7

Is Passenger compiled with Ruby embedded?

Zequez
  • 3,399
  • 2
  • 31
  • 42

3 Answers3

16

To set the Ruby version add this line to your vhost file:

PassengerRuby /path/to/the/ruby/version/you/want/to/use
sosborn
  • 14,676
  • 2
  • 42
  • 46
  • @marimaf it depends entirely on your hosting setup. – sosborn May 07 '12 at 01:36
  • I just ran $locate vhost and didnt get any files named just vhost. All I got where some apache http_vhost.h, mod_vhost_alias.so and httpd-vhosts.conf – marimaf May 07 '12 at 01:41
  • Well, like I said everything would depend on your setup. The conf is what you are looking for. If you want more info you should ask a new question on serverfault.com – sosborn May 07 '12 at 04:39
7

Whenever a "bundle update" updates the version of the passenger gem, I do

sudo su -
passenger-install-apache2-module

At the end of that process, it spits out the full blob of stuff that you need to put at the top or your Apache config. E.g. something like:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p180@rails31/gems/passenger-3.0.9
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p180@rails31/ruby

I update the blob of stuff, restart Apache and all seems well.

I imagine that this same process is necessary after updating Ruby.

cailinanne
  • 8,332
  • 5
  • 41
  • 49
4

Set PassengerRuby before the <Directory> tag.

Example:

PassengerRuby /home/ubuntu/.rvm/wrappers/ruby-2.3.1/ruby

It is working for me!

Find more detail in this post.

Scott Weldon
  • 9,673
  • 6
  • 48
  • 67
Jigar Bhatt
  • 4,217
  • 2
  • 34
  • 42