Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Nil output buffer in capture helper

#4023

I found this bug while tried to make own copy of edge rails guides, so..

Problem is:

/usr/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta/lib/action_view/helpers/capture_helper.rb:147:in with_output_buffer': undefined methodencoding' for nil:NilClass (NoMethodError)

If see on the code:
buf.force_encoding(output_buffer.encoding) if buf.respond_to?(:force_encoding)

but output_buffer is nil!
For me, I add a dirty hack that did the work:

class NilClass

def encoding
    "utf-8"
end

end

I think, output_buffer must be defined before work with it...

Reported by rap-kasta · February 21st, 2010 @ 04:58 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to Low

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    February 2nd, 2011 @ 10:15 AM

  2. bingbing