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.
Delicious
Digg This Post
Facebook
Reddit This Post
No related posts.





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?
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.
Thank you!
Support FREE exchange of carbon offsets! Say no to cap and trade!