# Rawk no longer works on Rails 2.2.2

**URL:** <https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895>\
**Category:** Rails\
**Created:** [November 22, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895 "2008-11-22T14:51:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [November 22, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895/1 "2008-11-22T14:51:04Z")

</div>

I just wanted to let you know that the hack to make rawk work on Rails  
2.2.2 by grouping action calls no longer works.

## This is the hack, I have put the TODO where the line crashes Rails:

## module ActiveSupport class BufferedLogger def add(severity, message = nil, progname = nil, &block) return if @level \> severity message = (message || (block && block.call) || progname).to\_s # If a newline is necessary then create a new message ending with a newline. # Ensures that the original message is not mutated. message = “#{message} (pid:#{$$})” if RAILS\_ENV==“production” message = “#{message}\n” unless message[-1] == ?\n @buffer \<\< message # TODO: this line no longer works with Rails 2.2.2 auto\_flush message end end end

## The error message is the following:

## Error during failsafe response: undefined method `<<' for {}:Hash (originally undefined method`\<\<’ for {}:Hash)

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [November 22, 2008, 2:57pm UTC](https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895/2 "2008-11-22T14:57:55Z")

</div>

On 22 Nov 2008, at 13:51, Fernando P. wrote:

> ```
> message = (message || (block && block.call) || progname).to_s
> # If a newline is necessary then create a new message ending with
> 
> ```
> 
> a newline.  
> # Ensures that the original message is not mutated.  
> message = “#{message} (pid:#{$$})” if RAILS\_ENV==“production”  
> message = “#{message}\n” unless message[-1] == ?\n  
> @buffer \<\< message # TODO: this line no longer works with Rails

that line needs to be changed to buffer \<\< message

Fred

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [November 22, 2008, 3:31pm UTC](https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895/3 "2008-11-22T15:31:19Z")

</div>

Frederick C. wrote:

> On 22 Nov 2008, at 13:51, Fernando P. wrote:
> 
> > ```
> > message = (message || (block && block.call) || progname).to_s
> > # If a newline is necessary then create a new message ending with
> > 
> > ```
> > 
> > a newline.  
> > # Ensures that the original message is not mutated.  
> > message = “#{message} (pid:#{$$})” if RAILS\_ENV==“production”  
> > message = “#{message}\n” unless message[-1] == ?\n  
> > @buffer \<\< message # TODO: this line no longer works with Rails
> 
> that line needs to be changed to buffer \<\< message
> 
> Fred

Smashing it works! Thanks Fred. How did you know about that? Do you  
often dive into Rails source code?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [November 22, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/rawk-no-longer-works-on-rails-2-2-2/153895/4 "2008-11-22T15:46:02Z")

</div>

On Nov 22, 2:31 pm, Fernando P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Frederick C. wrote:

> > that line needs to be changed to buffer \<\< message
> 
> > Fred
> 
> Smashing it works! Thanks Fred. How did you know about that? Do you  
> often dive into Rails source code?

Well if you look at the original method this one is replacing it  
seemed fairly obvious.

Fred
