Rails app randomly crashes with error “Premature end of script headers”

◇◆丶佛笑我妖孽 提交于 2019-11-29 06:01:37

It turns out that I was merely hitting my memory cap on the DreamHost shared server.

I was running several Rails apps under one account, many of them just for testing and prototyping. Rails uses a lot of memory and so I was quickly reaching my allocation. Support told me that "I checked our logs and it's killed one of your ruby processes 2325 times over the last three days". Whoops.

The solution: try not to run Rails in a shared environment, if you can help it. I'm going to switch at least one of my apps to a VPS host soon.

Are you running the latest version of passenger (2.2.2 at the time of writing). I had a few errors myself but most (if not all) disappeared after upgrading my passenger installation.

If that's not the answer you can always try to upgrade your rails version to 2.3 and see if the problem persists.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!