From: Martin Maciaszek Date: 2002-01-09T10:00:39+09:00 Subject: Re: eruby only generates text/plain In article <20020108121102.B26120@ninja1.internal>, Sean Chittenden wrote: >> > cd /usr/ports/textproc/eruby/work/eruby-0.9.7/examples >> > eruby -Mc text.rhtml head -1 >> > >> > Does that specify the Content-type correctly? -sc >> > >> Yes, that works correctly. >> >> Content-Type: text/html; charset=iso-8859-1 >> >> Can you explain me, what is going on here? > > Nope, not really. I was really hoping that'd come back as text/plain, > but if it's coming back as text/html... can you verify that it's > sending the content type as text/plain? My best suggestion would be > to crank up the debugging and see if that helps. Otherwise I'd > suggest trying modruby@modruby.net: I've never seen this before and > maybe Shugo has an idea. What version of eRuby are you using? -sc > This is what the browser sees: <0>fastjack@fuchi[7]:~$ echo -e "GET /hello.rhtml HTTP/1.0\n" | nc nexus 80 | grep -i content-type Content-Type: text/plain Now the _same_ script executed directly: <0>fastjack@nexus[1001]:~$ eruby -Mc /var/www/htdocs/hello.rhtml| grep -i content-type Content-Type: text/html; charset=iso-8859-1 At first I would suspect apache to reset the content-type but setting the Apache.request.content_type explicitly solves the problem. (As I was curious I wrote a small script that would display the contents of Apache.request.content_type and what did I find in there? "text/plain") Seems like the some weird initialisation error. This occurs with ruby 1.6.6, eRuby 0.9.7 and mod_ruby 0.9.4 on an Apache 1.3.22 (on Solaris 8 x86 10/01) Cheers Martin ps: I'll send an extra message to modruby@modruby.net just to make sure :)