Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

bhavinkamani opened this issue Dec 7, 2010 · 0 comments

Comments

@bhavinkamani
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant