This project is archived and is in readonly mode.

#4023 ✓stale
rap-kasta

Nil output buffer in capture helper

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

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...

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages