rbx wtih Apache 2

B

Barrow H Kwan

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_=--
 
J

John Feezell

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>"
-----------------------


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



--
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top