Logan Capaldo
2/8/2006 6:09:00 PM
On Feb 8, 2006, at 9:16 AM, Sam Joseph wrote:
> Hi Zev,
>
> Zev Blut wrote:
>
>> This looks like you have a "puts someobj.inspect" in your code.
>> Depending upon how you are running your system this rogue puts is
>> being called before the header output and is going directly to the
>> output stream. This is why your attempt to cut it out does not work.
>
> Indeed I have suspected as much.
>
>> I would grep your code for an "inspect" and if that fails "puts".
>
> I had already done so - I have no "puts" or "print" outside my test
> classes, and no inspects outside of my logging code. I've used the
> eclipse search function to scan all the code, and find | xargs grep
> on the server. The only things that I can imagine being remotely
> responsible are things like:
>
> ./app/models/message.rb: raise "more than one read_message for
> this user/message pair #{self.inspect}, #{user.inspect}"
>
> and
>
> ./app/controllers/application.rb: logger.info 'error during
> workspace log: ' + e.inspect
>
> but these wouldn't affect stdout right?
>
> I'm sure there must be something dumping that information
> somewhere, but I can't find it in my code, or in rails code, and
> more disturbingly to me, I can't work out where in the rails code
> the first part of the http header is generated, i.e. 'HTTP/1.x 200
> OK', since the first call to output in cgi_process.rb is:
>
> output.write(@cgi.header(@headers))
>
> and @cgi.header(@headers) doesn't produce the first three lines of
> the http header as far as I can see, yet there are no other calls
> to output anything before that.
>
> Anyhow, I've worked around the problem by printing a new line
> before the @cgi.header(@headers) is printed, which has fixed things
> for the time being.
>
> CHEERS> SAM
>
>
>
>
>
>
>
Heres a thought:
use breakpoint to let you jump in after you produce the headers. Go
to the offending page, copy the inspect string of the object and in
the breakpoint session do something along the lines of the following:
ObjectSpace.to_enum(:each_object).find { |x| x.inspect ==
pasted_inspect_string }.try_some_methods_to_figure_out_where_this_guy_is
_from