Does not work with unicorn, rails 3 and ruby 1.9 #5

Open
bhavinkamani opened this Issue Dec 7, 2010 · 0 comments

Comments

Projects
None yet
1 participant

When this plugin is used with unicorn and ruby 1.9. It breaks with following error

Read error: #<NoMethodError: undefined method `each' for #<String:0x00000100d88118>>
/Volumes/DATA/Bhavin/.rvm/gems/ruby-1.9.2-p0/gems/unicorn-3.0.0/lib/unicorn/http_response.rb:45:in `http_response_write'

While debugging, line no. 59 rack/offline.rb is breaking the code.

[200, {"Content-Type" => "text/cache-manifest"}, body.join("\n")]

line no. 45 in unicorn/http_response.rb looks like

body.each { |chunk| socket.write(chunk) }

It would have worked in ruby 1.8. But in 1.9 since String#each is deprecated, the code breaks.

Not sure what is the best solution. Should it be passed as an array? In that case newline will not be send to the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment