From: Eleanor McHugh Date: 2008-03-15T20:45:43+09:00 Subject: Re: Webrick On 15 Mar 2008, at 11:20, abc- wrote: > i'm new to ruby and tried some code to get a small application. > I used Webrick to get a http server: > Now the problem is that i can see the html in my browser but the > result of embedded Ruby code only in my Konsole. Could anyone give > me the right direction. > Before serving the rhtml file to your web client you need to run ERb on it and capture the result, then serve it using a different method than HTTP::Servlet. I can't remember the details off-hand but if you look at my Camping presentation at http://slides.games-with-brains.net/ you'll find some simple examples of rolling WEBrick servers and integrating ERb is fairly simple. I usually just add it into the String class as a handy instance method: class String def apply_erb ERB.new(self).result end end so when generating the output for the server you'd have a line roughly like: my_content.apply_erb where my_content is the variable holding the rhtml page text, or a method that produces it. Ellie Eleanor McHugh Games With Brains ---- raise ArgumentError unless @reality.responds_to? :reason