500 internal error on apache

Discussion in 'Ruby' started by coke, Nov 30, 2004.

  1. coke

    coke Guest

    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
     
    coke, Nov 30, 2004
    #1
    1. Advertising

  2. On Wed, 1 Dec 2004, 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


    I think you'll need to tell us what you did to achieve that. There
    ae a number of ways of using Ruby with Apache, for one thing.

    > address of the .rb file into my broswer I get an 500 Internal error,I


    and can you tell us what is in the file?

    > have no clue and can't find anything on it.
    >
    > Specs:
    > Windows 98
    > Apache 1.3.31
    > Ruby 1.8
    >


    Hugh
     
    Hugh Sasse Staff Elec Eng, Nov 30, 2004
    #2
    1. Advertising

  3. coke

    Neil Stevens Guest

    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 -
    "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(?)
     
    Neil Stevens, Nov 30, 2004
    #3
  4. coke

    coke Guest

    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 <> 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 -
    > "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, Nov 30, 2004
    #4
  5. coke <> 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.rubyforge.org/

    Patrick

    --
    .... Press any key. Then press the any other key.
     
    Patrick Gundlach, Nov 30, 2004
    #5
  6. 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.modruby.net/en/

    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 <> 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 -
    >>"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, Dec 1, 2004
    #6
  7. coke

    coke Guest

    Very helpfull, thanks

    On Wed, 1 Dec 2004 11:56:12 +0900, Nicholas Van Weerdenburg
    <> 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.modruby.net/en/
    >
    > 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 <> 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 -
    > >>"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, Dec 1, 2004
    #7
  8. 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
    ><> 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.modruby.net/en/
    >>
    >>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 <> 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 -
    >>>>"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, Dec 1, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rod
    Replies:
    9
    Views:
    3,754
    Jim Cheshire [MSFT]
    Jul 26, 2004
  2. John Bonds
    Replies:
    2
    Views:
    2,738
    Amaryllis
    Aug 3, 2004
  3. Replies:
    5
    Views:
    80,157
    cpdarkman
    Aug 26, 2009
  4. Chuck B
    Replies:
    8
    Views:
    373
  5. adi222
    Replies:
    1
    Views:
    380
    Daniel Pitts
    Feb 25, 2007
Loading...

Share This Page