You are not logged in.

#1 2012-04-16 16:44:43

sjnims
Member
From: Atlanta, GA
Registered: 2010-11-07
Posts: 9
Website

Ruby on Rails w/ Passenger + NGINX Environment Woes

So I've got Ruby installed on my installation of Arch installed via pacman package, installed Rails via gem, passenger via gem, and manually compiled NGINX using ABS to add support for passenger and the real-ip module.

I created a new app, pointed NGINX at it and restarted NGINX, and was able to see the "Welcome to Rails..." default app.

What is interesting is when clicking on the system info link produced an error. Come to find out, I need to set the RAILS[ENV] to development, which from what I've read, when using NGINX + Passenger + Rails is accomplished via directive in NGINX config (I put mine inside this specific server's server block). Changing the directive to development and restarting NGINX produced the expected results...the link showed details about my rails configuration.

Obviously I understand that one can expose themselves to potential threats by sharing this information, so to speak. So it makes sense Ruby won't allow the system info to be called in production. However, that is not my point.

I'm following along on http://guides.rubyonrails.org/getting_s … ls-project, and get through section 4.3, update NGINX to run in production, restart, and expect to see my "Hello, world." message. I don't. I wind up changing the environment directive in NGINX back to development, restart, et voila, I can see my page.

Why doesn't the app run in production? I know the default for Ruby standalone is to run in development, but the NGINX passenger docs state when running with this setup, Ruby defaults to production. I have no idea how to change from one to the other, or how to set that my app should be able to run in production. The guide I'm following doesn't mention anything about the need to switch environments, so what gives?

Thanks in advance for any help you can provide...

P.S. Version info:

ruby --version --> ruby 1.9.3p125 (2012-02-16 revision 34643) [i686-linux]
rails --version --> Rails 3.2.3
nginx-1.0.14-1-i686.pkg.tar.xz
passenger --version --> Phusion Passenger version 3.0.11

Offline

Board footer

Powered by FluxBB