bigpotato
bigpotato

Reputation: 27497

Apache: Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configuration

I'm using Rails 3 + Apache + Passenger, and I'm trying to deploy to a new server. I'm not too familiar with where RailsEnv comes from and am getting this error when checking the syntax of my apache config.

Invalid command 'RailsEnv', perhaps misspelled or defined by a module not included in the server configuration

Does anyone know what module RailsEnv comes from ?

Upvotes: 10

Views: 12256

Answers (2)

Luke
Luke

Reputation: 1649

For me this was because I copied a linux server config to my mac installation:

<IfModule mod_passenger.c>
  LoadModule passenger_module .../mod_passenger.so
  PassengerRoot .../locations.ini
  PassengerDefaultRuby .../ruby
</IfModule>

Removing the <IfModule> tags fixed it for me. I'm guessing mod_passenger.c doesn't exist on the mac, so then the passenger module is never loaded at all.

Upvotes: 0

vee
vee

Reputation: 38645

Install Apache passenger module, following the guides here for your specific environment: http://blog.phusion.nl/2011/03/02/phusion-passenger-3-0-4-released/

Then, enable the module using:

sudo a2enmod passenger

Finally restart apache.

Upvotes: 19

Related Questions