[Backgroundrb-devel] [ANN] New release!

Ezra Zygmuntowicz ezmobius at gmail.com
Tue Jun 13 11:48:08 EDT 2006

On Jun 13, 2006, at 12:38 AM, P.Mark Anderson wrote:

>> Please have a look and let me know if anyone runs into any issues.
> Ezra,
> This is fantastic!
> However, it's not working for me.  I think it's because my app's
> custom config (in config/environments/stuff.rb) does not appear to be
> loaded along with the rest of Rails.  Could that be?
> 	uninitialized constant StuffModule
> Thanks for your awesome work,
> pmark
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel

Hey PMark-

	Yeah that's what it is. When backgroundrb starts up and the  
load_rails config is set to true, all I do is require boot.rb and  
then set up the db connection. If you have other classes that don't  
get loaded when just boot.rb is required then you will need to  
explicitly require them.

	BackgrounDRb doesn't need all of rails loaded. THat would make it  
consume way more memory then it needs to run.  I am open for  
suggestions though on how to better handle this. Maybe I can create a  
config file option where you can list the classes you need to  
require. For now you should just open script/backgroundrb/start and  
add a require for the file you need. USe rails root to qualify its  
path. So say you have RAILS_ROOT/lib/stuff_module.rb that you need to  

Look for this line and add your require right after it.

# Require all worker classes in lib/workers/
Dir["#{RAILS_ROOT}/lib/workers/*"].each{ |worker| require worker }

require "#{RAILS_ROOT}/lib/stuff_module"

	Let me know if you run into any more problems.


More information about the Backgroundrb-devel mailing list