我在共享托管服务器上安装任何Ruby On Rails 应用程序时遇到问题。Mongrel 将 html 显示为所有页面的纯文本。任何应用程序都会出现此问题,即使我创建了一个测试空应用程序并添加了一个脚手架视图而不进行任何更改。
尝试将 cookie 放入响应标头时,Mongrel 似乎崩溃了。HTTP 标头看起来不完整,缺少 Content-type 和其他参数:
curl 127.0.0.1:12002/users -I
HTTP/1.1 200 OK
Connection: close
Date: Wed, 26 May 2010 09:46:50 GMT
Content-Length: 0
这是 mongrel.log 的输出
Error calling Dispatcher.dispatch #<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]>
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/cgi.rb:108:in `send_cookies'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/cgi.rb:136:in `out'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/http_response.rb:65:in `start'
红宝石 1.8.7 轨道 2.3.8 杂种 1.1.5
这是测试页面的链接。
有没有人见过这样的事情?