2013-03-20 29 views
0

我從遷移Rails的2至3 Rails的一個大工地當我試圖得到一個資產,我得到使用下面的錯誤WebrickRails的錯誤服務資產

Started GET "/assets/key.png" for 127.0.0.1 at 2013-03-20 11:00:06 -0300 
Served asset /key.png - 200 OK (15ms) 
[2013-03-20 11:00:08] ERROR NoMethodError: undefined method `each' for nil:NilClass 
    /usr/local/rvm/gems/ruby-1.9.3-p327/gems/rack-1.4.5/lib/rack/handler/webrick.rb:71:in `service' 
    /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service' 
    /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run' 
    /usr/local/rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread' 

我已經檢查機架源代碼和問題是在以下行的文件webrick.rb的(身體無):

body.each { |part| 
     res.body << part 
     } 

使用Thin我收到了類似的錯誤:

Started GET "/assets/key.png" for 127.0.0.1 at 2013-03-20 11:34:31 -0300 
Served asset /key.png - 200 OK (33ms) 
!! Rack application returned nil body. Probably you wanted it to be an empty string? 
!! Unexpected error while processing request: undefined method `each' for nil:NilClass 

並在瀏覽器:

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. 

我一直在努力與此錯誤。任何幫助?

+0

也許你應該嘗試更新機架到更新的版本? – 2013-03-20 14:12:17

+0

我該怎麼辦?我也試過乘客,它沒有工作。但讓我知道如何更新機架。 – Tony 2013-03-20 14:19:57

+0

我會說'寶石更新架':) – 2013-03-20 14:25:04

回答

2

我發現了這個問題。

這與memcache有關。我沒有安裝它。

我只是評論如下一行:

config.cache_store =:mem_cache_store

0

事實上,它有一個丟失了內存緩存服務器做。在我的例子中,我發現Heroku還發布了關於設置一個快速的小型memcached服務器的說明,以便在本地複製您的生產環境。