Rails应用程序错误:脚本头premature结束

问题描述:

我的设置:Ubuntu的LTS 12.04,阿帕奇,Phusion的客运,最新的Ruby和Rails

My setup: Ubuntu 12.04 LTS, Apache, Phusion Passenger, latest Ruby and Rails.

当我访问我的网站,我得到一个500内部服务器错误。
错误日志文件:脚本头premature结束

When I visit my website, I get a 500 Internal Server Error. Error Logfiles: Premature end of script headers

是否有人知道如何解决这个问题?

Does somebody know how to solve that problem?

如果您已在配置/数据库配置为制作的数据库。阳明海运,它并不像你在评论中提到的服务器上,这可能是你的问题的根源,因为它未能建立数据库连接。

If you have a database configured for production in your config/database.yml that doesn't exist on the server as you mentioned in the comments, that could be the source of your issue since it's failing to establish a database connection.

从用于连接你的的config / database.yml的并重新启动您的应用程序。

Remove that connection from your config/database.yml and restart your app.