rbx wtih Apache 2

Discussion in 'Ruby' started by Barrow H Kwan, Jun 30, 2003.

  1. This is a multipart message in MIME format.
    --=_alternative 001F7CBF88256D55_=
    Content-Type: text/plain; charset="US-ASCII"

    I have tested Ruby ( with rbx rather than rhtml ) with Apache2 without any
    luck.

    I got the following error in Apache log when I hit
    http://<mysite>/test.rbx

    [Sun Jun 29 22:28:15 2003] [error] mod_ruby: error in ruby
    (eval): uninitialized constant Ruby at Apache (NameError)
    from ruby:0:in `value'


    and here is my test.rbx
    #!/export/opt/ruby/ruby-1.6.8/bin/ruby

    print "HTTP/1.0 200 OK\r\n"
    print "Content-type: text/html\r\n\r\n"
    print "<html><body>Hello World!</body></html>\r\n"


    any help will be appreciated!

    thanks

    Barrow
    --=_alternative 001F7CBF88256D55_=
    Content-Type: text/html; charset="US-ASCII"


    <br><font size=2 face="sans-serif">I have tested Ruby ( with rbx rather
    than rhtml ) with Apache2 without any luck.</font>
    <br>
    <br><font size=2 face="sans-serif">I got the following error in Apache
    log &nbsp;when I hit &nbsp;http://&lt;mysite&gt;/test.rbx</font>
    <br>
    <br><font size=2 face="sans-serif">[Sun Jun 29 22:28:15 2003] [error] mod_ruby:
    error in ruby</font>
    <br><font size=2 face="sans-serif">(eval): uninitialized constant Ruby
    at Apache (NameError)</font>
    <br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; from ruby:0:in
    `value'</font>
    <br>
    <br>
    <br><font size=2 face="sans-serif">and here is my test.rbx</font>
    <br><font size=2 face="sans-serif">#!/export/opt/ruby/ruby-1.6.8/bin/ruby</font>
    <br>
    <br><font size=2 face="sans-serif">print &quot;HTTP/1.0 200 OK\r\n&quot;</font>
    <br><font size=2 face="sans-serif">print &quot;Content-type: text/html\r\n\r\n&quot;</font>
    <br><font size=2 face="sans-serif">print &quot;&lt;html&gt;&lt;body&gt;Hello
    World!&lt;/body&gt;&lt;/html&gt;\r\n&quot;</font>
    <br>
    <br>
    <br><font size=2 face="sans-serif">any help will be appreciated!</font>
    <br>
    <br><font size=2 face="sans-serif">thanks</font>
    <br>
    <br><font size=2 face="sans-serif">Barrow</font>
    --=_alternative 001F7CBF88256D55_=--
     
    Barrow H Kwan, Jun 30, 2003
    #1
    1. Advertising

  2. Barrow H Kwan

    John Feezell Guest

    Here is a listing of a test file I use.
    Note I had to mod .htaccess to include: AddHandler cgi-script rbx
    -----------------------
    #!/mypath/to/bin/ruby # This is a properly working ruby script running ruby
    script with extension .rbx
    # If the key for ENV does not exist, then ruby returns nil.
    # It required the following modification to .htaccess in www
    # AddHandler cgi-script rbx
    #

    require 'date'
    print "Content-type: text/html\n\n"
    d = Date.new(2000, 3, 31)
    #print $:,'</p>'
    print ENV['RUBYPATH'],'</br>'
    print [d.year, d.yday, d.wday]
    print "this is a test.", ENV['PATH'], "prefix= ",ENV['prefix'],"<br>"
    names = ["john", "mary", "", 4]
    data = [1, 2, 3, 4]
    data.each do |i |
    print i, " ", names[i-1],"<br>"
    end
    print "<h1>Environment variables</h1><table>" ENV.keys.sort.each do |key|
    print "<tr><th>",key,"</th><td>", ENV[key], "</td>"
    print "</tr>"
    end
    print "</table>"
    -----------------------


    On Mon, 30 Jun 2003 14:43:57 +0900, Barrow H Kwan <>
    wrote:

    > I have tested Ruby ( with rbx rather than rhtml ) with Apache2 without
    > any luck.
    >
    > I got the following error in Apache log when I hit
    > http://<mysite>/test.rbx
    >
    > [Sun Jun 29 22:28:15 2003] [error] mod_ruby: error in ruby
    > (eval): uninitialized constant Ruby at Apache (NameError)
    > from ruby:0:in `value'
    >
    >
    > and here is my test.rbx
    > #!/export/opt/ruby/ruby-1.6.8/bin/ruby
    >
    > print "HTTP/1.0 200 OK\r\n"
    > print "Content-type: text/html\r\n\r\n"
    > print "<html><body>Hello World!</body></html>\r\n"
    >
    >
    > any help will be appreciated!
    >
    > thanks
    >
    > Barrow




    --
     
    John Feezell, Jun 30, 2003
    #2
    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. avinashrk
    Replies:
    10
    Views:
    4,790
    Andrew Thompson
    Dec 14, 2004
  2. chris patton

    the problem wtih cgi

    chris patton, May 28, 2005, in forum: Python
    Replies:
    3
    Views:
    307
    Ivan Van Laningham
    May 29, 2005
  3. pizza
    Replies:
    1
    Views:
    547
    Eliyahu Goldin
    Mar 8, 2007
  4. kwatch
    Replies:
    0
    Views:
    139
    kwatch
    Oct 14, 2003
  5. Ruby Tuesday

    mod_ruby(.rbx) newbie

    Ruby Tuesday, Jan 18, 2004, in forum: Ruby
    Replies:
    5
    Views:
    156
    Ollivier Robert
    Jan 21, 2004
Loading...

Share This Page