Problem with Borges,Apache and dRuby

I’m experimenting with Borges again and stopped at following error.

While trying use Borges in Apache through dRuby.

In got following error in apache/error.log:
/home/radek/opt/ruby-1.8.0-2003.05.20/lib/ruby/site_ruby/1.8/borges/ApacheDRbClient.rb:23:in handle_with': undefined methodcontentType’ for #Borges::Response:0x403dc840 (NoMethodError)
from /var/www/borges/hello.rbx:5
from /home/radek/opt/ruby-1.8.0-2003.05.20/lib/ruby/1.8/apache/ruby-run.rb:70:in load' from /home/radek/opt/ruby-1.8.0-2003.05.20/lib/ruby/1.8/apache/ruby-run.rb:70:inhandler’

The ruby is the last cvs version, apache is 1.3.26-0woody3 Borges are
lates from cvs and also 0.2.0. dRuby is version 2.0.4b1
and 2.0.3. The message is always the same.

So in the file ApacheDRbClient in line 23 there is
21 res = DRbObject.new(nil, server_uri).handle_request(req)
22
23 ar.content_type = res.contentType
24 ar.status = res.status
25 ar.send_http_header

The apache page is hello.rbx:
#!/usr/bin/env ruby

$Id:$

$Source:$

require 'borges/ApacheDRbClient’
Borges::ApacheDRbClient.handle_with(‘druby://127.0.0.1:7001’)
#EOF

The server hello_srv.rb:
#!/usr/bin/env ruby -w

$Id:$

$Source:$

require 'hello.rb’
require 'borges’
require ‘borges/ApacheDRbServer’

Borges::ApacheDRbServer.start(‘druby://127.0.0.1:7001’)
Borges::ApacheDRbServer.install_INT_handler
puts "Borges DRb Server listening on #{DRb.uri}"
puts "Press Ctrl-c to quit"
DRb.thread.join
#EOF

When running server it says:
$ ruby hello_srv.rb
Borges DRb Server listening on druby://127.0.0.1:7001
Press Ctrl-c to quit

and is waiting. Now accessign the page http://yoda/borges/hello.rbx
genereates the error message I wrote previously.

···


Radek Hnilica

No matter how far down the wrong road you’ve gone, turn back.
Turkish proverb

Ok, I wrote the quick&dirty hack.
The method contentType of class Response was not defined. So:

— Utilities.rb.~1.10.~ Mon May 19 23:45:48 2003
+++ Utilities.rb Tue May 20 17:34:11 2003
@@ -158,6 +158,10 @@
def application_url
Borges.base_url + @application_key
end

···
  • def contentType
  • @headers[‘content-type’]
  • end
    end


Radek Hnilica

No matter how far down the wrong road you’ve gone, turn back.
Turkish proverb