<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Ah, think I see it now.</div><div><br class="webkit-block-placeholder"></div><div>Try changing your TestingWorker to use Time.now.to_s not Time.now_to_s. If you check the backgroundrb log files you will probably see a no method error somewhere.</div><div><br></div><div>Geoff</div><div><br class="webkit-block-placeholder"></div><br><div><div>On 25 Jun 2007, at 18:52, Tiberiu Motoc wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi Geoff,</div>  <div> </div>  <div>Yes, I do have it at the end of the script. I just forgot to copy it in the message.</div>  <div> </div>  <div>Tiberiu<br><br><b><i>Geoff Garside &lt;<a href="mailto:ruby@geoffgarside.co.uk">ruby@geoffgarside.co.uk</a>&gt;</i></b> wrote:</div>  <blockquote class="replbq" style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">  <div>  <div>On 25 Jun 2007, at 01:28, Tiberiu Motoc wrote:</div><br class="Apple-interchange-newline">  <blockquote type="cite">  <div>Hi everyone,</div>  <div> </div>  <div>I'm new to backgroundrb, and I'm trying to get started with a simple example, yet with no success.</div>  <div> </div>  <div>This is the code that I have in RAILS_ROOT/lib/workers/testing_worker.rb</div>  <div>class TestingWorker &lt; BackgrounDRb::Worker::RailsBase</div>  <div>  def do_work(args)<br>    # This method is called in it's own new thread when you<br>    # call new worker. args is set to :args</div>  <div>    logger.info('TestingWorker do work')<br>    results[:do_work_time] = Time.now_to_s<br>    results[:done_with_do_work] || = true<br>  end</div>  <div>end</div></blockquote>  <div><br class="webkit-block-placeholder"></div>  <div>Do you have</div>  <div><br class="webkit-block-placeholder"></div>  <div><span class="Apple-tab-span" style="WHITE-SPACE: pre"></span>TestingWorker.register<br class="webkit-block-placeholder"></div>  <div><br class="webkit-block-placeholder"></div>  <div>at the end of the testing_worker.rb file?</div><br>  <blockquote type="cite">  <div> </div>  <div>And this is the code that I have in RAILS_ROOT/app/controllers/mytest2_controller.rb</div>  <div>class Mytest2Controller &lt; ApplicationController<br>  def new<br>    key = MiddleMan.new_worker(:class =&gt; :testing_worker)<br>    worker = MiddleMan.worker(key)<br>    #worker.other_method<br>    #worker.delete<br>  end<br>end</div></blockquote>  <blockquote type="cite">  <div> </div>  <div>And this is what I get when I access: <a href="http://host:3000/mytest2/new">http://host:3000/mytest2/new</a></div>  <div> NameError in Mytest2Controller#new</div>  <div> uninitialized constant TestingWorker<br> RAILS_ROOT: script/../config/..<br> Application Trace | Framework Trace | Full Trace</div>  <div> </div>  <div>I don't understand why I'm getting the "uninitialized constant" error. I've read other postings with the same issue, and I understand that you must restart the server after adding/making modifications to your workers. The server is restarted with the following commands: ./script/backgroundrb stop and ./script/bacgroundrb start, right? (I don't even think this applies to me, since first I created all necessary files for the example and then I started the server; I did restart the server several times just to make sure this is not a problem)</div>  <div>I also tried to use the console and I get a similar message.</div>  <div>Btw, I have changed nothing in the default setup, except in /server/lib/backgroundrb/console.rb, where I commented out the line "require 'irb/completion'" due to a strange error that I was getting.</div>  <div> </div>  <div>Thanks,</div>  <div>Tiberiu</div>  <div> </div>  <div>PS. I want to make sure that the way I downloaded backgroundrb is not faulty. Instead of getting it via subversion (trying to save time by not involving my admin), I just downloaded file by file from <a href="http://svn.devjavu.com/backgroundrb/tags/release-0.2.1">http://svn.devjavu.com/backgroundrb/tags/release-0.2.1</a>.</div>  <div><br class="khtml-block-placeholder"></div>  <hr size="1">  Ask a question on any topic and get answers from real people. <a href="http://ca.answers.yahoo.com/"><b>Go to Yahoo! Answers.</b></a>  <div style="MARGIN: 0px">_______________________________________________</div>  <div style="MARGIN: 0px">Backgroundrb-devel mailing list</div>  <div style="MARGIN: 0px"><a href="mailto:Backgroundrb-devel@rubyforge.org">Backgroundrb-devel@rubyforge.org</a></div>  <div style="MARGIN: 0px"><a href="http://rubyforge.org/mailman/listinfo/backgroundrb-devel">http://rubyforge.org/mailman/listinfo/backgroundrb-devel</a></div></blockquote><br></div>  <div>Regards,</div>  <div>Geoff</div><br></blockquote><br><div>       <br class="khtml-block-placeholder"></div><hr size="1"><a href="http://us.rd.yahoo.com/evt=40705/*http://mrd.mail.yahoo.com/try_beta?.intl=ca"><b>All new Yahoo! Mail </b></a> <hr size="1">Get news delivered. Enjoy RSS feeds right on your Mail page.</blockquote></div><br></body></html>