# Fcgi

**URL:** <https://rubytalk.org/t/fcgi/29261>\
**Category:** ruby-talk\
**Created:** [25 July 2006 01:50 UTC](https://rubytalk.org/t/fcgi/29261 "2006-07-25T01:50:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Allison](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@Tom\_Allison](https://rubytalk.org/u/Tom_Allison)\
**Post date:** [25 July 2006 01:50 UTC](https://rubytalk.org/t/fcgi/29261/1 "2006-07-25T01:50:23Z")

</div>

I am a little familiar with running FCGI applications and have done some work in Perl.

Under Perl I can test it easily enough by running the script from command line with STDIN/STDOUT and command line args. But this doesn't work at all under ruby.

A different approach is needed.

Is there something I could do to simplify the testing/development of fcgi scripts under ruby instead of editing them in cgi-bin and trying to run them from there?

---

<div class="post-metadata">

**Author:** ![Ara.T.Howard6](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@Ara.T.Howard6](https://rubytalk.org/u/Ara.T.Howard6)\
**Post date:** [25 July 2006 04:54 UTC](https://rubytalk.org/t/fcgi/29261/2 "2006-07-25T04:54:37Z")

</div>

??

&nbsp;&nbsp;&nbsp;fortytwo :/var/www/html \> cat ./env2.fcgi  
&nbsp;&nbsp;&nbsp;#! /usr/local/bin/ruby

&nbsp;&nbsp;&nbsp;require 'rubygems' rescue nil  
&nbsp;&nbsp;&nbsp;require 'fcgi'  
&nbsp;&nbsp;&nbsp;require 'yaml'

&nbsp;&nbsp;&nbsp;FCGI.each\_cgi{|cgi| cgi.out{ "\<pre\>#{ cgi.env\_table.to\_hash.to\_yaml }\</pre\>" }}

&nbsp;&nbsp;&nbsp;fortytwo :/var/www/html \> ./env2.fcgi \</dev/null | head  
&nbsp;&nbsp;&nbsp;Content-Type: text/html  
&nbsp;&nbsp;&nbsp;Content-Length: 4037

&nbsp;&nbsp;&nbsp;\<pre\>---  
&nbsp;&nbsp;&nbsp;XAUTHORITY: /home/ahoward/.Xauthority  
&nbsp;&nbsp;&nbsp;GS\_LIB: /home/ahoward/.fonts  
&nbsp;&nbsp;&nbsp;SSH\_ASKPASS: /usr/libexec/openssh/gnome-ssh-askpass  
&nbsp;&nbsp;&nbsp;KONSOLE\_DCOP\_SESSION: DCOPRef(konsole-4421,session-4)  
&nbsp;&nbsp;&nbsp;MAIL: /var/spool/mail/ahoward  
&nbsp;&nbsp;&nbsp;KDEDIR: /usr

hth.

-a

> **···**
>
> On Tue, 25 Jul 2006, Tom Allison wrote:
> 
> > I am a little familiar with running FCGI applications and have done some  
> > work in Perl.
> > 
> > Under Perl I can test it easily enough by running the script from command  
> > line with STDIN/STDOUT and command line args. But this doesn't work at all  
> > under ruby.
> > 
> > A different approach is needed.
> > 
> > Is there something I could do to simplify the testing/development of fcgi  
> > scripts under ruby instead of editing them in cgi-bin and trying to run them  
> > from there?
> 
> --  
> suffering increases your inner strength. also, the wishing for suffering  
> makes the suffering disappear.  
> - h.h. the 14th dali lama
