Passenger 2.1.1 and Local Production Environment

If you’re on the Passenger 2.1.1 beta and can’t figure out why your rails app is going in to the production mode, it’s because it sets the RackEnv environment variable production instead of the RailsEnv variable. This is fine on rails 2.3+ apps because they are based on Rack but if you have a rails 2.2.2 app or below, you’ll need the following in your apps passenger site config:


<VirtualHost*:80>
  ServerName myserver.local
  DocumentRoot "/myapp/public"
  RackEnv development
  RailsEnv development
  <directory "/myapp/public">
    Order allow,deny
    Allow from all
  </directory>
</VirtualHost>

Update: I thought I should add, based on Hongli Lai’s response in the comments, that this is with me using the passenger preference pane in Leopard. That might be the culprit. Is anyone else seeing this problem? Let me know in the comments.

Post to Twitter Post to Delicious Delicious Post to Digg Digg This Post Post to Facebook Facebook Post to Reddit Reddit This Post

No related posts.

Tags:

4 Responses to “Passenger 2.1.1 and Local Production Environment”

  1. Hongli Lai 04. Mar, 2009 at 11:43 pm #

    That's strange, Passenger should set RAILS_ENV, not RACK_ENV. Maybe you have a config.ru in your application root, which makes Passenger think that it's a Rack application instead of a Rails application?

  2. jasonseifer 04. Mar, 2009 at 11:51 pm #

    Thanks for the reply. I suppose I should mention that this was a Rails 2.2.2 app that I already had set up with the Passenger preference pane in Leopard. For some reason, after I installed the beta gem, it set RackEnv to development when I added it using the preference pane. I had to add the above to get it to work.

    PS: Thanks so much for all of the fantastic work on Passenger and REE.

  3. Rob Corell 20. Mar, 2009 at 7:37 pm #

    Thank you!

  4. trade 30. Jul, 2009 at 6:36 pm #

    Support FREE exchange of carbon offsets! Say no to cap and trade!

Leave a Reply