Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change Passenger Ruby version without recompiling?

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

Is Passenger compiled with Ruby embedded?

like image 409
Zequez Avatar asked Nov 12 '11 02:11

Zequez


2 Answers

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

PassengerRuby /path/to/the/ruby/version/you/want/to/use
like image 164
sosborn Avatar answered Oct 12 '22 13:10

sosborn


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.

like image 31
cailinanne Avatar answered Oct 12 '22 11:10

cailinanne