[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

500 internal error on apache

coke

11/30/2004 5:53:00 PM

I came across Ruby about 33 hours and decided to take it up.I have
exp. with apache,php and such but no cgi,perl or anything close to
ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
address of the .rb file into my broswer I get an 500 Internal error,I
have no clue and can't find anything on it.

Specs:
Windows 98
Apache 1.3.31
Ruby 1.8


7 Answers

Hugh Sasse

11/30/2004 6:06:00 PM

0

Neil Stevens

11/30/2004 9:36:00 PM

0

On Wed, 01 Dec 2004 02:53:24 +0900, coke wrote:

> I came across Ruby about 33 hours and decided to take it up.I have
> exp. with apache,php and such but no cgi,perl or anything close to
> ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
> address of the .rb file into my broswer I get an 500 Internal error,I
> have no clue and can't find anything on it.
>
> Specs:
> Windows 98
> Apache 1.3.31
> Ruby 1.8

Check your Apache error log after seeing the 500 error to see what's wrong
with the ruby you're attempting to run.

--
Neil Stevens - neil@hakubi.us
"The world is a dangerous place to live; not because of the people who
are evil, but because of the people who don't do anything about it."
-- Albert Einstein(?)

coke

11/30/2004 10:04:00 PM

0

I'm very new to cgi and have no background of programming other than a
little php editing and that's it.After seeing hugh's message I went
back to the test script and looked for typos and surly there was one.I
corrected the typo and everything worked fine,thanks for the replys.


On Wed, 1 Dec 2004 06:37:56 +0900, Neil Stevens <neil@hakubi.us> wrote:
> On Wed, 01 Dec 2004 02:53:24 +0900, coke wrote:
>
>
>
> > I came across Ruby about 33 hours and decided to take it up.I have
> > exp. with apache,php and such but no cgi,perl or anything close to
> > ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
> > address of the .rb file into my broswer I get an 500 Internal error,I
> > have no clue and can't find anything on it.
> >
> > Specs:
> > Windows 98
> > Apache 1.3.31
> > Ruby 1.8
>
> Check your Apache error log after seeing the 500 error to see what's wrong
> with the ruby you're attempting to run.
>
> --
> Neil Stevens - neil@hakubi.us
> "The world is a dangerous place to live; not because of the people who
> are evil, but because of the people who don't do anything about it."
> -- Albert Einstein(?)
>
>


Patrick Gundlach

11/30/2004 11:10:00 PM

0

coke <coke2k5@gmail.com> writes:

> I'm very new to cgi and have no background of programming other than a
> little php editing and that's it.After seeing hugh's message I went
> back to the test script and looked for typos and surly there was one.I
> corrected the typo and everything worked fine,thanks for the replys.

You also might find prettyexception useful. I think it is a great tool
for web development/debugging.

http://muravey-tools.ruby...

Patrick

--
.... Press any key. Then press the any other key.

Nicholas Van Weerdenburg

12/1/2004 2:56:00 AM

0

Since you mention being new to cgi, and have doning some php, I'm
guessing you aren't using the ruby script in the right directory, or
using the right url to call it, or are missing some boilerplate.

Ruby and php are not directly equivalent. If you've only installed
ruby, you need to put the ruby script into your cgi-bin directory,
since cgi is how you would call it.

e.g.
http://localhost/cgi-bin/test.rb

would be the right url for a file in the apache cgi-bin directory.

Also, you may need to put some http boilerplate.
test.rb
======
#!/usr/local/bin/ruby
print "Content-type: text/html\r\n\r\n"
print "hello"

On Apache on OS X, I need the second line for it to work. The first line
is Unix specific, and won't apply to Windows.

There is also a cgi module to help with many common cgi tasks that you
can look at.

If you want to use ruby in the same way as Php, you need to install
mod_ruby and eruby:
http://www.modru...

Then you can create files like index.rhtml, and use embedded ruby code,
much like how php works. This may be your best starting point if you
like the php method.

Or install a web framework like rails, iowa, arrow, etc, and follow
their conventions.

Regards,
Nick

coke wrote:

>I'm very new to cgi and have no background of programming other than a
>little php editing and that's it.After seeing hugh's message I went
>back to the test script and looked for typos and surly there was one.I
>corrected the typo and everything worked fine,thanks for the replys.
>
>
>On Wed, 1 Dec 2004 06:37:56 +0900, Neil Stevens <neil@hakubi.us> wrote:
>
>
>>On Wed, 01 Dec 2004 02:53:24 +0900, coke wrote:
>>
>>
>>
>>
>>
>>>I came across Ruby about 33 hours and decided to take it up.I have
>>>exp. with apache,php and such but no cgi,perl or anything close to
>>>ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
>>>address of the .rb file into my broswer I get an 500 Internal error,I
>>>have no clue and can't find anything on it.
>>>
>>>Specs:
>>>Windows 98
>>>Apache 1.3.31
>>>Ruby 1.8
>>>
>>>
>>Check your Apache error log after seeing the 500 error to see what's wrong
>>with the ruby you're attempting to run.
>>
>>--
>>Neil Stevens - neil@hakubi.us
>>"The world is a dangerous place to live; not because of the people who
>>are evil, but because of the people who don't do anything about it."
>> -- Albert Einstein(?)
>>
>>
>>
>>
>
>
>


coke

12/1/2004 3:27:00 AM

0

Very helpfull, thanks

On Wed, 1 Dec 2004 11:56:12 +0900, Nicholas Van Weerdenburg
<nick@activehitconsulting.com> wrote:
> Since you mention being new to cgi, and have doning some php, I'm
> guessing you aren't using the ruby script in the right directory, or
> using the right url to call it, or are missing some boilerplate.
>
> Ruby and php are not directly equivalent. If you've only installed
> ruby, you need to put the ruby script into your cgi-bin directory,
> since cgi is how you would call it.
>
> e.g.
> http://localhost/cgi-bin/test.rb
>
> would be the right url for a file in the apache cgi-bin directory.
>
> Also, you may need to put some http boilerplate.
> test.rb
> ======
> #!/usr/local/bin/ruby
> print "Content-type: text/html\r\n\r\n"
> print "hello"
>
> On Apache on OS X, I need the second line for it to work. The first line
> is Unix specific, and won't apply to Windows.
>
> There is also a cgi module to help with many common cgi tasks that you
> can look at.
>
> If you want to use ruby in the same way as Php, you need to install
> mod_ruby and eruby:
> http://www.modru...
>
> Then you can create files like index.rhtml, and use embedded ruby code,
> much like how php works. This may be your best starting point if you
> like the php method.
>
> Or install a web framework like rails, iowa, arrow, etc, and follow
> their conventions.
>
> Regards,
> Nick
>
>
>
> coke wrote:
>
> >I'm very new to cgi and have no background of programming other than a
> >little php editing and that's it.After seeing hugh's message I went
> >back to the test script and looked for typos and surly there was one.I
> >corrected the typo and everything worked fine,thanks for the replys.
> >
> >
> >On Wed, 1 Dec 2004 06:37:56 +0900, Neil Stevens <neil@hakubi.us> wrote:
> >
> >
> >>On Wed, 01 Dec 2004 02:53:24 +0900, coke wrote:
> >>
> >>
> >>
> >>
> >>
> >>>I came across Ruby about 33 hours and decided to take it up.I have
> >>>exp. with apache,php and such but no cgi,perl or anything close to
> >>>ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
> >>>address of the .rb file into my broswer I get an 500 Internal error,I
> >>>have no clue and can't find anything on it.
> >>>
> >>>Specs:
> >>>Windows 98
> >>>Apache 1.3.31
> >>>Ruby 1.8
> >>>
> >>>
> >>Check your Apache error log after seeing the 500 error to see what's wrong
> >>with the ruby you're attempting to run.
> >>
> >>--
> >>Neil Stevens - neil@hakubi.us
> >>"The world is a dangerous place to live; not because of the people who
> >>are evil, but because of the people who don't do anything about it."
> >> -- Albert Einstein(?)
> >>
> >>
> >>
> >>
> >
> >
> >
>
>


Nicholas Van Weerdenburg

12/1/2004 5:13:00 AM

0

Glad to help.

I'd recommend checking out #ruby-lang and #rubyonrails IRC groups. Great
for immediate feedback/help.

Nick

coke wrote:

>Very helpfull, thanks
>
>On Wed, 1 Dec 2004 11:56:12 +0900, Nicholas Van Weerdenburg
><nick@activehitconsulting.com> wrote:
>
>
>>Since you mention being new to cgi, and have doning some php, I'm
>>guessing you aren't using the ruby script in the right directory, or
>>using the right url to call it, or are missing some boilerplate.
>>
>>Ruby and php are not directly equivalent. If you've only installed
>>ruby, you need to put the ruby script into your cgi-bin directory,
>>since cgi is how you would call it.
>>
>>e.g.
>>http://localhost/cgi-bin/test.rb
>>
>>would be the right url for a file in the apache cgi-bin directory.
>>
>>Also, you may need to put some http boilerplate.
>>test.rb
>>======
>>#!/usr/local/bin/ruby
>>print "Content-type: text/html\r\n\r\n"
>>print "hello"
>>
>>On Apache on OS X, I need the second line for it to work. The first line
>>is Unix specific, and won't apply to Windows.
>>
>>There is also a cgi module to help with many common cgi tasks that you
>>can look at.
>>
>>If you want to use ruby in the same way as Php, you need to install
>>mod_ruby and eruby:
>> http://www.modru...
>>
>>Then you can create files like index.rhtml, and use embedded ruby code,
>>much like how php works. This may be your best starting point if you
>>like the php method.
>>
>>Or install a web framework like rails, iowa, arrow, etc, and follow
>>their conventions.
>>
>>Regards,
>>Nick
>>
>>
>>
>>coke wrote:
>>
>>
>>
>>>I'm very new to cgi and have no background of programming other than a
>>>little php editing and that's it.After seeing hugh's message I went
>>>back to the test script and looked for typos and surly there was one.I
>>>corrected the typo and everything worked fine,thanks for the replys.
>>>
>>>
>>>On Wed, 1 Dec 2004 06:37:56 +0900, Neil Stevens <neil@hakubi.us> wrote:
>>>
>>>
>>>
>>>
>>>>On Wed, 01 Dec 2004 02:53:24 +0900, coke wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>I came across Ruby about 33 hours and decided to take it up.I have
>>>>>exp. with apache,php and such but no cgi,perl or anything close to
>>>>>ruby.I've configured my apache(ver. 1.3.31) for ruby.When I type the
>>>>>address of the .rb file into my broswer I get an 500 Internal error,I
>>>>>have no clue and can't find anything on it.
>>>>>
>>>>>Specs:
>>>>>Windows 98
>>>>>Apache 1.3.31
>>>>>Ruby 1.8
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Check your Apache error log after seeing the 500 error to see what's wrong
>>>>with the ruby you're attempting to run.
>>>>
>>>>--
>>>>Neil Stevens - neil@hakubi.us
>>>>"The world is a dangerous place to live; not because of the people who
>>>>are evil, but because of the people who don't do anything about it."
>>>> -- Albert Einstein(?)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>
>