In my worker class, when i try to start the worker thread, it throws the error: uninitialized constant LoginEngine - (NameError) /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../app/models/user.rb:3 /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:98:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../lib/workers/monitor_messageboards_worker.rb:18:in `do_work'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../vendor/plugins/backgroundrb/backgroundrb_rails.rb:35:in `start_process'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../vendor/plugins/backgroundrb/backgroundrb_rails.rb:31:in `start_process'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../vendor/plugins/backgroundrb/backgroundrb.rb:57:in `new_worker'' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/../../config/../vendor/plugins/backgroundrb/backgroundrb.rb:49:in `new_worker'' /usr/lib/ruby/1.8/drb/drb.rb:1552:in `perform_without_block'' /usr/lib/ruby/1.8/drb/drb.rb:1512:in `perform'' /usr/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'' /usr/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'' /usr/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'' /usr/lib/ruby/1.8/drb/drb.rb:1427:in `run'' /usr/lib/ruby/1.8/drb/drb.rb:1424:in `run'' /usr/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'' /usr/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'' /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/start:96 /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/start:92 /home/foo_fighter/public_html/fooapp/config/../script/backgroundrb/start:84 any ideas why? and how to prevent this? -- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060825/6feaee72/attachment.html
I geuss, I am the one, who is asking this question again.I tried to search through, the mails, but clearly...following solutions didn''t work for me: $: << "#{RAILS_ROOT}/vendor/plugins/engines/lib/engines" $: << "#{RAILS_ROOT}/vendor/plugins/login_engine/lib" Also, i last time, I worked around the problem by simply not using loginengine model class.But this time, as it seems i need this. There is a price to be paid, for using some readymade component. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060825/04dc27c1/attachment-0001.html
Ezra Zygmuntowicz
2006-Aug-25 15:13 UTC
[Backgroundrb-devel] uninitialised constant LoginEngine
On Aug 25, 2006, at 4:39 AM, hemant wrote:> I geuss, I am the one, who is asking this question again.I tried to > search through, the mails, but clearly...following solutions didn''t > work for me: > > $: << "#{RAILS_ROOT}/vendor/plugins/engines/lib/engines" > $: << "#{RAILS_ROOT}/vendor/plugins/login_engine/lib" > > Also, i last time, I worked around the problem by simply not using > loginengine model class.But this time, as it seems i need this. > There is a price to be paid, for using some readymade component. > > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-develHey Hemant- What I think you need to do is open up the start script and replace the line that require''s boot.rb and make it require environment.rb., THat way it will go through rails normal load process and your engines will get loaded as well. This has bitten enough people that I am going to change it so that by default it will require all of rails if you set load_rails to true in your config file. Its an inconosistency on my part the way it works now. Cheers- -Ezra
Again i managed to workaround the problem, by simply not using user.rbfiles(model class defined by LoginEngine). :) but...i had another issue, some of my model classes, were using some global connection objects( not to databases but Unix socket connections to some data vending servers).Now, this connection object was created in environment.rb file, so i required the file in that worker thread and it started to work. but, isn''t it that loading the entire rails environment is a little heavy?? On 8/25/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:> > > On Aug 25, 2006, at 4:39 AM, hemant wrote: > > > I geuss, I am the one, who is asking this question again.I tried to > > search through, the mails, but clearly...following solutions didn''t > > work for me: > > > > $: << "#{RAILS_ROOT}/vendor/plugins/engines/lib/engines" > > $: << "#{RAILS_ROOT}/vendor/plugins/login_engine/lib" > > > > Also, i last time, I worked around the problem by simply not using > > loginengine model class.But this time, as it seems i need this. > > There is a price to be paid, for using some readymade component. > > > > > > > > _______________________________________________ > > Backgroundrb-devel mailing list > > Backgroundrb-devel at rubyforge.org > > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > Hey Hemant- > > What I think you need to do is open up the start script and > replace > the line that require''s boot.rb and make it require environment.rb., > THat way it will go through rails normal load process and your > engines will get loaded as well. > > This has bitten enough people that I am going to change it so that > by default it will require all of rails if you set load_rails to true > in your config file. Its an inconosistency on my part the way it > works now. > > Cheers- > -Ezra >-- nothing much to talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060826/5323936b/attachment.html