URGENT HELP! Problem in render

Hi all,

I am having a problem with render function of rails. I have an
application layout which has the following code:

<%= render :partial => ‘common/message’ %>

which is to render partial to display messages. I have the
_message.rhtml in the views/common folder. But when i hit the url there
is an error:

Expected kind of Outputter, got NilClass

The Application Trace is:

c:/ruby/RDE/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r/logger.rb:115:in
add' c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:30:inbenchmark’
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_view/partials.rb:58:in
render_partial' c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:756:inrender_partial’
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:680:in
render_with_no_layout' c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:253:inrender_without_benchmark’
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
render' c:/ruby/RDE/lib/ruby/1.8/benchmark.rb:293:inmeasure’
c:/ruby/RDE/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
render' #{RAILS_ROOT}/app/controllers/dbparser_controller.rb:103:inparsesql’

What might be the problem? Please help.

Regards,
Janeve

i don’t think you’re problem is a render problem, but a log4r problem.

from logger.rb

# Add outputters by name or by reference. Can be done any time.
def add(*_outputters)
  for thing in _outputters
    o = (thing.kind_of?(Outputter) ? thing : Outputter[thing])
    # some basic validation
    if not o.kind_of?(Outputter)
      raise TypeError, "Expected kind of Outputter, got #{o.class}", 

caller
elsif o.nil?
raise TypeError, “Couldn’t find Outputter ‘#{thing}’”, caller
end
@outputters.push o
Logger.log_internal {“Added outputter ‘#{o.name}’ to
‘#{@fullname}’”}
end
@outputters
end

the first line in that method is what is causing the error.

Chris

Chris H. wrote:

i don’t think you’re problem is a render problem, but a log4r problem.

from logger.rb

# Add outputters by name or by reference. Can be done any time.
def add(*_outputters)
  for thing in _outputters
    o = (thing.kind_of?(Outputter) ? thing : Outputter[thing])
    # some basic validation
    if not o.kind_of?(Outputter)
      raise TypeError, "Expected kind of Outputter, got #{o.class}", 

caller
elsif o.nil?
raise TypeError, “Couldn’t find Outputter ‘#{thing}’”, caller
end
@outputters.push o
Logger.log_internal {“Added outputter ‘#{o.name}’ to
‘#{@fullname}’”}
end
@outputters
end

the first line in that method is what is causing the error.

Chris

Thanks Chris,

Is there any way i can solve this problem? I need log4r in my
application.

  • Janeve

i think you are out of luck…

http://dev.rubyonrails.org/ticket/3512