Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a new Rails 3 app through Apache Passenger, and am trying to run it in the stage environment. I have my configuration file set up properly according to the documentation as well as previous Apache Passenger apps, but I can't get it to run in the proper environment, even though I'm specifying it in my VirtualHost config as so:

RailsEnv stage

Any suggestions?

Note: If it matters, I'm using Ruby 1.9.2-p0

share|improve this question
up vote 5 down vote accepted

Rails 3 counts as a rack application, so change the config to:

RackEnv stage
share|improve this answer

It seems there is a bug in Passenger at least up to 3.0.5 where the RackEnv cannot differ between virtual hosts. If you have multiple virtual hosts with different RackEnv settings, then the first RackEnv that is used will be global, i.e. the first site that a browser hits will define RackEnv setting for all virtual hosts.

This needs to be fixed quickly, it makes setting up staging environments for production sites next to impossible, and also makes multi-stage environments (e.g. hosting) impossible.

See also

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.