# eRuby questions

**URL:** <https://www.ruby-forum.com/t/eruby-questions/89553>\
**Category:** Ruby\
**Created:** [March 21, 2007, 5:31am UTC](https://www.ruby-forum.com/t/eruby-questions/89553 "2007-03-21T05:31:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 21, 2007, 5:31am UTC](https://www.ruby-forum.com/t/eruby-questions/89553/1 "2007-03-21T05:31:26Z")

</div>

Hi,

I have been trying to find alternatives and faster way of serving  
server side HTML or WML from Ruby instead of serving it through an ERB  
program or through a RAILS program.

This question is somewhat related to an earlier question posted by  
Sunny H…

I have begun evaluating eRuby and configured it with Apache on a  
Windows Machine.

Basic ruby output seems to be working fine, but whenever I try use CGI  
methods to read request parameters or create cookies, an internal  
server 500 is being thrown.

Can anyone tell me,

If anyone has configured and used eRuby for serving dynamic WEB / WML  
pages  
Are there standard bench marks to see the performance difference  
between RAILS vs ERB vs eRuby vs ERUBIS and which is the best  
recommended ?

Azif

---

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 21, 2007, 5:36am UTC](https://www.ruby-forum.com/t/eruby-questions/89553/2 "2007-03-21T05:36:26Z")

</div>

> Are there standard bench marks to see the performance difference  
> between RAILS vs ERB vs eRuby vs ERUBIS and which is the best  
> recommended ?

Erubis claims to be fastest eRuby implementation. Never seen any  
dispute about it.

---

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 21, 2007, 6:40am UTC](https://www.ruby-forum.com/t/eruby-questions/89553/3 "2007-03-21T06:40:29Z")

</div>

On Wed, Mar 21, 2007 at 01:30:08PM +0900, Dude wrote:

> I have begun evaluating eRuby and configured it with Apache on a  
> Windows Machine.

Do you mean Apache with mod\_ruby, or some other way?

[http://wiki.modruby.net/en/?InstallGuide](http://wiki.modruby.net/en/?InstallGuide) (but I’m not sure mod\_ruby runs  
under Windows)

> Basic ruby output seems to be working fine, but whenever I try use CGI  
> methods to read request parameters or create cookies, an internal  
> server 500 is being thrown.

What is written to your Apache error log?

---

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 22, 2007, 6:30am UTC](https://www.ruby-forum.com/t/eruby-questions/89553/4 "2007-03-22T06:30:30Z")

</div>

Here’s the apache error log…

–

[Wed Mar 21 14:33:16 2007] [notice] Child 696: Starting thread to  
listen on port 8080.  
[Wed Mar 21 14:33:22 2007] [error] [client 127.0.0.1] Premature end of  
script headers: eruby.exe  
[Wed Mar 21 14:33:22 2007] [error] [client 127.0.0.1] C:\Documents  
and Settings\Asif A.\user\WAPLanding\landingPage.rhtml:11:  
undefined local variable or method `cgi’ for main:Object (NameError)\

–  
None of the CGI methods seem to work with eRuby.

And no, I have not configured mod\_ruby - I have only directly  
configured eRuby.

Dude.

---

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 22, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/eruby-questions/89553/5 "2007-03-22T16:34:51Z")

</div>

On Mar 22, 2007, at 08:30, Dude wrote:

> undefined local variable or method `cgi’ for main:Object (NameError)  
> Hi, Dude!  
> Are you sure you haven’t forgotten the quotes:

require ‘cgi’

Yours sincerely,  
Damian/Three-eyed Fish

---

<div class="post-metadata">

**Author:** ![Dude](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f19dbf/32.png) [@Dude](https://www.ruby-forum.com/u/Dude)\
**Post date:** [March 22, 2007, 2:35pm UTC](https://www.ruby-forum.com/t/eruby-questions/89553/6 "2007-03-22T14:35:30Z")

</div>

On 3/22/07, Dude [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> undefined local variable or method `cgi’ for main:Object (NameError)\
> 
> –  
> None of the CGI methods seem to work with eRuby.
> 
> And no, I have not configured mod\_ruby - I have only directly  
> configured eRuby.

Is your eRuby emitting the HTTP response headers or just the body text?

The latter won’t do I think.

[http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers](http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers)

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
