Passenger – Run Rails app in development mode

When you run Rails app using Phusion Passenger (modrails), by default, it runs in ‘production’ mode. However, if you want to run it in ‘development’ mode for any reason, you need to add a directive in your apache/nginx configuration.

Apache:

RailsEnv development

For example,

....
RailsEnv development
....

You can put this option in any of the following places:

  • In the global server configuration.
  • In a virtual host configuration block.
  • In <Directory> or <Location> block.
  • In .htaccess, if AllowOverride Options is on.

Nginx:

....
rack_env development
....

You can put the above option in any of the following places:

  • In the http configuration block.
  • In a server configuration block.
  • In a location configuration block.
  • In an if configuration scope.