From: abc- Date: 2008-03-15T20:20:05+09:00 Subject: Webrick Hi, i'm new to ruby and tried some code to get a small application. I used Webrick to get a http server: require 'webrick' include WEBrick s = HTTPServer.new(:Port => 8000) # Add a mime type for *.rhtml files HTTPUtils::DefaultMimeTypes.store('rhtml', 'text/html') # Required for CGI on Windows; unnecessary on Unix/Linux s.config.store( :CGIInterpreter, "#{HTTPServlet::CGIHandler::Ruby}") # Mount servlets s.mount('/test', HTTPServlet::FileHandler, '/') # Trap signals so as to shutdown cleanly. ['TERM', 'INT'].each do |signal| trap(signal){ s.shutdown } end # Start the server and block on input. s.start and i created an rhtml file: Ruby Test

Test

<% require 'mysql' %> <% my = Mysql::new("localhost", "root", "", "books_development") %> <% res = my.query("select ID,Name from books Limit 10") %> <% res.each { |i| puts "" } %>
#{i}
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. Thanks in advance dirk --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://www.shemes.com/ =-