[Aiml-programr-developers] Tests and Architecture
Nicholas H.Tollervey
ntoll at ntoll.org
Mon Sep 17 15:19:13 EDT 2007
Mauro,
Works a treat! Thanks for the help, I thought it might be something to
do with an un-referenced library but was unsure what/how.
Nicholas
mauro at cicio.org wrote:
> The to_yaml method is part of the standard library YAML module
> (http://www.ruby-doc.org/stdlib/libdoc/yaml/rdoc/index.html).
>
> Why is not working on my PC but not on yours?
> I think that the explanation can be one of the following:
> 1 - ruby version (1.8.4)
> 2 - I have all the rails library in the path
>
> One thing you might want to try is to include explicitely the YAML module:
>
> class Response
> include YAML
> attr_reader :body, :session_id
> def initialize(body, session_id)
> @body, @session_id = body, session_id
> end
> end
>
> and if this giver problems, to require the lib:
> require 'yaml'
> class Response
> ...
>
>
> I hope this will do...
>
> Ciao,
> Mauro
>
>
> On 17/09/2007, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
>
>> Hi Mauro,
>>
>> Still no luck with the code you sent. The server part now runs but when
>> the browser queries it I get the following:
>>
>> $ ruby browser.rb
>> demo$ hello
>> (druby://127.0.0.1:7001) ./lib/comm/bot_proxy.rb:11:in `handle':
>> undefined method `to_yaml' for #<Response:0xb7c86718 @session_id=3,
>> @body="olleh"> (NoMethodError)
>> from ./lib/comm/p_r_plugin.rb:28:in `handle'
>> from ./lib/comm/p_r_plugin.rb:14:in `hanlde'
>> from ./webserver.rb:18:in `get'
>> from browser.rb:18:in `start'
>> from browser.rb:23
>>
>> As you can see, the thing seems to work up to returning the
>> Response.to_yaml method. I've looked in the code and there isn't one
>> defined. :-(
>>
>> Is there something missing?
>>
>> Best wishes,
>>
>> Nicholas
>>
>>
>
>
More information about the Aiml-programr-developers
mailing list