How can I get Rails to run under Passenger on Nginx?
I am really struggling with this. I have decided to switch to Passenger after having so many struggles with Passenger/Ruby on Apache. Ruby processes kept chewing up CPU, and taking 30 minutes to process a syntax error in a view.
So now I have the same problem. I in开发者_如何学编程stalled Passenger no problem. Followed the directions to use Passenger to download and install Passenger. Done. I am using Ruby Enterprise version.
I added the Passenger-specified server entry into my nginx.conf for my Rails 3 application. nginx -t says the syntax of the conf file is good.
I start nginx with:
sudo nginx
seems to start. Then I go to the url I specified in my conf file and it just CHURNS. I can see in Activity Monitor that a ruby processor comes up and just SPINS, chewing up CPU as it goes. Up to 100% until I have to reboot my machine.
What is wrong? This is maddening, I REALLY appreciate any help.
That sounds more like your server has so little RAM that it can't even start a single Rails process without swapping to death. Try running script/console from a terminal. Does that work and does it work quickly?
It's either that, or you have a bug in your application's startup code which causes this behavior.
Take a look at:
http://library.linode.com/frameworks/ruby-on-rails-nginx/
Slicehost is also an excellent source for this kind of help (though I'm not sure if they have a Passenger/nginx tutorial at the moment):
http://articles.slicehost.com/
I've used tutorials from both sites and they are very clear and helpful.
精彩评论