Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6172589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:25:15+00:00 2026-05-23T23:25:15+00:00

I am trying to serve up static content for some web development, with a

  • 0

I am trying to serve up static content for some web development, with a few lines of erb to simulate what the real server will do. I already did this with WEBrick here: http://ceronio.net/2011/06/nice-web-server-script-to-server-any-directory-using-webrick, but now I want to do this with Mongrel.

My code so far is like this:

#!/usr/bin/ruby
require 'rubygems'
require 'mongrel'
Mongrel::DirHandler.add_mime_type('.rhtml', 'text/html')
server = Mongrel::HttpServer.new("localhost", 2000)
server.register("/", Mongrel::DirHandler.new(Dir::pwd))
server_thread = server.run
server_thread.join

But when I access my index.rhtml file, it does not process the content in the <% %> tags, but just passes the file as is to the browser.

With WEBrick, nothing additional was required. What do I need to do here to get the server-side Ruby code processed in the .rhtml file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:25:15+00:00Added an answer on May 23, 2026 at 11:25 pm

    After looking through the code of the DirHandler class in Mongrel, it seems that this class is not made for applying any processing to a file, but just serving it up as is.

    It seems the only way to do this in Mongrel would be to modify DirHandler or write your own HttpHandler.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a blog/messageboard that uses static HTML files to serve content.
We are trying to design 6 web services, which will serve another client component.
I'm trying to use Connect to serve static content, but with large files (>
I'm trying for a week to make my XSP server work with simple static
Trying to setup an SSH server on Windows Server 2003. What are some good
I'm trying to implement a basic web server in Java. When I direct a
I'm trying to do a request to a server with some POST parameters, I
I'm trying to serve static files for download in a django application, I figured
I'm trying to serve the static files from a Wordpress installation and I'm using
So I am trying to serve large files via a PHP script, they are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.