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.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Rails 3.0.0 ActionDispatch::Response.default_charset not initialized

#5593

My rails app was returning some pages with "Content-Type: text/html; charset=" which messed up page rendering in the browser.

In actionpack/lib/action_dispatch/http/response.rb on line 137 the intention seems to be to initialize the attribute with utf8 ie:

cattr_accessor(:default_charset) { "utf-8" }

However in extlib 0.9.15 cattr_accessor does not accept a block. I have worked around this with the line:

ActionDispatch::Response.default_charset="utf-8"

in my rails apps config/application.rb

Reported by Mike Leddy · September 9th, 2010 @ 05:35 PM

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

Activity

  1. Mike Leddy
    Mike Leddy

    Further investigation leads me to the fact that:

    activesupport-3.0.0/lib/active_support/core_ext/class/attribute_accessors.rb

    adds block handling to cattr_accessor.

    However, I have no idea why it isn't working. I have a clean user rvm install of ruby-1.9.2-p0.

    September 9th, 2010 @ 05:52 PM

  2. Mike Leddy
    Mike Leddy
    • Tag changed from rails 3.0.0 to rails 3.0.0, resolved

    Please ignore - Not a bug but a gem conflict. I had unnecessarily included extlib in the app's Gemfile (its used by non-rails parts of my application).

    September 9th, 2010 @ 06:53 PM

  3. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    September 12th, 2010 @ 05:08 AM

  4. Sam Woodard
    Sam Woodard

    This is super helpful. Beware of extlib, it does exactly what Mike describes above. My issue was that I had chef in my Gemfile which requires extlib.

    February 8th, 2011 @ 11:12 PM