The first time I start up my app I invariably get "We're sorry, but something went wrong."

If I run WEBrick with "rails server -e production" the site loads fine at port 3000. After I've done this everything loads fine via nginx, and I can there are no problems with the app and it loads to my heart's content.

But if I redeploy again, update the code etc as mentioned above, same problem. I need to run WEBrick one time for the passenger-nginx setup to serve the app. And this is driving me crazy. I have no idea why the app doesn't load by itself, and what could WEBrick possibly be doing when it loads that is causing it to then make Passenger work? Help!

You should check the Nginx log file and the production.log and find out what exactly is the problem. One general hint: If you are ssh'ing into the server you are using user-specific environment settings Nginx is not able to use if it's started as a system service.
–
iltempoNov 9 '12 at 8:24

Thanks, you nailed it. Wrong user permissions. I edited the user line in nginx.conf and that seemed to fix it. Though still seems strange that it would work after launching WEBrick, no?
–
user1594803Nov 9 '12 at 12:05