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

2

10

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 ?

Vu answered 21/8, 2013 at 15:53 Comment(2)
Do you have passenger module enabled, i.e. in Apache?Tempe
Nope I don't think so. How would I do that?Vu
T
19

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.

Tempe answered 21/8, 2013 at 16:15 Comment(2)
I get ERROR: Module passenger does not exist!Underclothing
just try install passenger apt-get install libapache2-mod-passengerLobule
R
0

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.

Receive answered 21/5, 2018 at 10:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.