[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Webrick problem, PREMATURE END OF SCRIPT HEADERS

Kevin Layman

3/22/2007 5:40:00 AM

I've downloaded and installed Ruby (v1.8.5) w/the latest Windows
installer and am trying to run some cgi's per these examples:
http://microjet.ath.cx/webrickguide/html/CGIHa...

I keep getting HTTP 500 - Internal server error, and in the Ruby command
line PREMATURE END OF SCRIPT HEADERS.

I've got the path to the Ruby executable in test.cgi, and the next line
outputs a valid header, and this cgi will execute correctly when run by
Webrick directly. Programs are below.


test.cgi:
#!g:\ruby\bin\ruby.exe
print "Content-type: text/plain\r\n\r\n"
ENV.keys.sort.each{|k| puts "#{k} ==> #{ENV[k]}"}

cgi_handler.rb:
require 'webrick'

include WEBrick # let's import the namespace so
# I don't have to keep typing
# WEBrick:: in this documentation.

def start_webrick(config = {})
# always listen on port 8080
config.update(:Port => 8080)
server = HTTPServer.new(config)
yield server if block_given?
['INT', 'TERM'].each {|signal|
trap(signal) {server.shutdown}
}
server.start

end

#start_webrick(:DocumentRoot =>
"g:/infoproweb/webfolder/cgi-bin/ruby",:CGIInterpreter =>
"g:/ruby/bin/ruby.exe")
start_webrick(:DocumentRoot => "g:/infoproweb/webfolder/")


start_webrick {|server|
#cgi_dir = File.expand_path('~/cgi-bin/ruby')
cgi_dir = "g:/infoproweb/webfolder/cgi-bin/ruby"
server.mount("/cgi-bin/ruby", HTTPServlet::FileHandler, cgi_dir,
{:FancyIndexing=>true})
}

--
Posted via http://www.ruby-....

15 Answers

PerfectDayToChaseTornados

3/22/2007 8:18:00 PM

0


"Kevin Layman" <kwlayman@yahoo.com> wrote in message
news:d069c243a419b320e40fc9de0a2e6b8d@ruby-forum.com...
> I've downloaded and installed Ruby (v1.8.5) w/the latest Windows
> installer and am trying to run some cgi's per these examples:
> http://microjet.ath.cx/webrickguide/html/CGIHa...
>
> I keep getting HTTP 500 - Internal server error, and in the Ruby command
> line PREMATURE END OF SCRIPT HEADERS.
>
> I've got the path to the Ruby executable in test.cgi, and the next line
> outputs a valid header, and this cgi will execute correctly when run by
> Webrick directly. Programs are below.
>
>
> test.cgi:
> #!g:\ruby\bin\ruby.exe
> print "Content-type: text/plain\r\n\r\n"
> ENV.keys.sort.each{|k| puts "#{k} ==> #{ENV[k]}"}
>
> cgi_handler.rb:
> require 'webrick'
>
> include WEBrick # let's import the namespace so
> # I don't have to keep typing
> # WEBrick:: in this documentation.
>
> def start_webrick(config = {})
> # always listen on port 8080
> config.update(:Port => 8080)
> server = HTTPServer.new(config)
> yield server if block_given?
> ['INT', 'TERM'].each {|signal|
> trap(signal) {server.shutdown}
> }
> server.start
>
> end
>
> #start_webrick(:DocumentRoot =>
> "g:/infoproweb/webfolder/cgi-bin/ruby",:CGIInterpreter =>
> "g:/ruby/bin/ruby.exe")
> start_webrick(:DocumentRoot => "g:/infoproweb/webfolder/")
>
>
> start_webrick {|server|
> #cgi_dir = File.expand_path('~/cgi-bin/ruby')
> cgi_dir = "g:/infoproweb/webfolder/cgi-bin/ruby"
> server.mount("/cgi-bin/ruby", HTTPServlet::FileHandler, cgi_dir,
> {:FancyIndexing=>true})
> }
>
> --
> Posted via http://www.ruby-....

You probably have something else already running on that port. Either start
Webrick on a different port or stop whatever is bound to that port.

--
pdtct


Paul Stickney

3/22/2007 8:42:00 PM

0

Try to run that program using ruby directly.
It might be something as simple as a syntax error.

Starting WEBrick from a ``CGI'' like that looks kind of odd...

moslem cartoon character mohammad the koos was a goat fucking child molesting POS

2/3/2009 2:50:00 AM

0

Mash_Ghasem = Sasan Pasabani, on the payroll hack of the Tayyebi
family.

W

Death to Bahaism

2/3/2009 5:11:00 AM

0

On Feb 2, 10:25 pm, "All Bad" <AllBad_notrea...@md.metrocast.net>
wrote:
> I'm thinking it is about MIA1's void accusation about Baha'is deleting
> information at Sourcewatch.

Void and voiding is something that is the bedrock of your cult and
what is in your brain and what animates your community of voided
refuse, since you are all void because you have been voided.

http://www.sourcewatch.org/index.php?title=Esra%27a_Al_Shafei&acti...

Here's your void accusation turned into substantive evidence, in just
one single magical wave of the hand. MIA can furnish you more.

W

Death to Bahaism

2/3/2009 5:22:00 AM

0

On Feb 3, 8:49 am, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
> On Feb 2, 4:00 am, Viv <viv_jacob...@hotmail.co.uk> wrote:
>
> > Nima  (“Wahid”) says that I have committed a major gaffe in claiming
> > that this exchange means he is admitting that he’ll say anything to do
> > the Baha’is down.
>
> > You, dear reader, can decide for yourself (a thing he doesn’t want you
> > to do judging by the wave of spam he has unleashed).
>
>  We know about him for a long time.

You know what?

> He has no credibilty in SCI.

You have no credibility on SCI or anywhere else so don't talk about
anyone elses. I if I had no credibility, your handlers wouldn't
unleash you like a mangy dog. So that's for that.

> Saddly we supported him against Bahais for a while so in my case I do
> appologize to Susan Maneck. Hope she accepts my sincere appology.

How low can you go!
http://www.fglaysher.com/bahaicensorship/M...
http://misspiggymaneck.blo...

W

raturvey@yahoo.co.uk

2/3/2009 3:05:00 PM

0

On Feb 2, 10:49 pm, mash_ghasem <ghyath_ab...@yahoo.com> wrote:

>
>  We know about him for a long time. He has no credibilty in SCI.
> Saddly we supported him against Bahais for a while so in my case I do
> appologize to Susan Maneck. Hope she accepts my sincere appology.
>
Forgive my ignorance, what is SCI?

Andrew

mash_ghasem

2/3/2009 5:57:00 PM

0

On Feb 3, 10:05 am, "ratur...@yahoo.co.uk" <ratur...@yahoo.co.uk>
wrote:
> On Feb 2, 10:49 pm, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
>
>
> >  We know about him for a long time. He has no credibilty in SCI.
> > Saddly we supported him against Bahais for a while so in my case I do
> > appologize to Susan Maneck. Hope she accepts my sincere appology.
>
> Forgive my ignorance, what is SCI?
>
> Andrew

There is no reason for apology Sir Andrew. English language is full
of accronymes and abbreviations and SCI in this context stands for
Soc.Culture.Iranian.


.

maybeiam101

2/4/2009 1:26:00 AM

0

On Feb 4, 3:57 am, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
> On Feb 3, 10:05 am, "ratur...@yahoo.co.uk" <ratur...@yahoo.co.uk>
> wrote:
>
> > On Feb 2, 10:49 pm, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
> > >  We know about him for a long time. He has no credibilty in SCI.
> > > Saddly we supported him against Bahais for a while so in my case I do
> > > appologize to Susan Maneck. Hope she accepts my sincere appology.
>
> > Forgive my ignorance, what is SCI?
>
> > Andrew
>
>  There is no reason for apology Sir Andrew. English language is full
> of accronymes and abbreviations and SCI in this context stands for
> Soc.Culture.Iranian.
>
> .

You seem to be going out of your way to prove Wahid's thesis about
north-american Iranians in California or New York, playing the servile
dupe to the white, Anglo-European master.

mash_ghasem

2/4/2009 11:40:00 PM

0

On Feb 3, 8:26 pm, maybeiam...@gmail.com wrote:
> On Feb 4, 3:57 am, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
>
>
>
>
> > On Feb 3, 10:05 am, "ratur...@yahoo.co.uk" <ratur...@yahoo.co.uk>
> > wrote:
>
> > > On Feb 2, 10:49 pm, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
> > > >  We know about him for a long time. He has no credibilty in SCI.
> > > > Saddly we supported him against Bahais for a while so in my case I do
> > > > appologize to Susan Maneck. Hope she accepts my sincere appology.
>
> > > Forgive my ignorance, what is SCI?
>
> > > Andrew
>
> >  There is no reason for apology Sir Andrew. English language is full
> > of accronymes and abbreviations and SCI in this context stands for
> > Soc.Culture.Iranian.
>
> > .
>
> You seem to be going out of your way to prove Wahid's thesis about
> north-american Iranians in California or New York, playing the servile
> dupe to the white, Anglo-European master.



hahahaha :-) Very feeble attempt but also funny. Almost as funny as
Nima's debriefing by IRI agents in Tehran regarding his anti Bahai
book :-)







- Hide quoted text -
>
> - Show quoted text -

moslem cartoon character mohammad the koos was a goat fucking child molesting POS

2/6/2009 4:54:00 AM

0

On Feb 5, 9:40 am, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
> On Feb 3, 8:26 pm, maybeiam...@gmail.com wrote:
>
>
>
>
>
> > On Feb 4, 3:57 am, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
> > > On Feb 3, 10:05 am, "ratur...@yahoo.co.uk" <ratur...@yahoo.co.uk>
> > > wrote:
>
> > > > On Feb 2, 10:49 pm, mash_ghasem <ghyath_ab...@yahoo.com> wrote:
>
> > > > >  We know about him for a long time. He has no credibilty in SCI.
> > > > > Saddly we supported him against Bahais for a while so in my case I do
> > > > > appologize to Susan Maneck. Hope she accepts my sincere appology.
>
> > > > Forgive my ignorance, what is SCI?
>
> > > > Andrew
>
> > >  There is no reason for apology Sir Andrew. English language is full
> > > of accronymes and abbreviations and SCI in this context stands for
> > > Soc.Culture.Iranian.
>
> > > .
>
> > You seem to be going out of your way to prove Wahid's thesis about
> > north-american Iranians in California or New York, playing the servile
> > dupe to the white, Anglo-European master.
>
>   hahahaha :-)  Very feeble attempt but also funny. Almost as funny as
> Nima's debriefing by IRI agents in Tehran regarding his anti Bahai
> book :-)

What's the name of it and when was it published?


W