Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid command 'PassengerDefaultRuby'

I am using using below versions

Phusion Passenger version 4.0.25

ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]

Server version: Apache/2.2.22 (Ubuntu)
Server built:   Jul 12 2013 13:38:21

I am pasting these three lines as per passenger instruction in apache.conf

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.25/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.25
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby

Here is details of my installed ruby

rvm rubies

   ruby-1.9.3-p448 [ i686 ]
=* ruby-2.0.0-p247 [ i686 ]

If I am restarting the Apache , I am getting following Error.

[Wed Nov 20 15:04:13 2013] [warn] module passenger_module is already loaded, skipping
Syntax error on line 242 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

I done lot of google search , but found only one link which not much helpful.

like image 367
Senthil Avatar asked Mar 21 '23 14:03

Senthil


2 Answers

I was experiencing the same issue on an Ubuntu 10.04 server machine. In my case it was like Hongli said, I had two passenger versions loaded. One was the package libapache2-mod-passenger from the Ubuntu repositories and another installed using RVM. To make it work with the one installed through RVM I unloaded the module loaded with the ubuntu package by running

a2dismod passenger

and then reload apache.

like image 129
user215556 Avatar answered Mar 24 '23 05:03

user215556


You probably have two Phusion Passenger versions loaded in Apache, one older version and one newer version. They're conflicting with each other. You need to uninstall all traces of Passenger that you can find, then install only the latest version.

like image 37
Hongli Avatar answered Mar 24 '23 03:03

Hongli