James Howison
2008-Jan-22 03:57 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
I''m using a plugin which adds a method to ActiveRecord::Base http://similetimelinerailshelper.googlecode.com/svn/trunk/simile_timeline/ This adds an "acts_as" type declaration to the Models, via the file in vendor/plugins/simile_timeline/lib/simile_timeline.rb Rails is working with these declarations, and they are being used successfully in ''regular Rails''. When I run script/backgroundrb start, I get an error saying that method is not found (error follows sig). Backgroundrb is able to start up with those acts_as declarations commented out. Presumably I need to require the plugin file somewhere, but I wondered if backgroundrb might be meant to load the same things as Rails, by default. Thanks, James [james at MinistryOfInformation2]$script/backgroundrb start /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:1532:in `method_missing'': undefined method `acts_as_simile_timeline_event'' for #<Class:0x11655fc> (NoMethodError) from /Users/james/Documents/University/Syracuse/Research/Dissertation/ fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Users/james/Documents/University/Syracuse/Research/Dissertation/ fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ framework/packet.rb:10 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from script/backgroundrb:16
hemant
2008-Jan-22 09:03 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
Hi, On Jan 22, 2008 9:27 AM, James Howison <james at howison.name> wrote:> I''m using a plugin which adds a method to ActiveRecord::Base > > http://similetimelinerailshelper.googlecode.com/svn/trunk/simile_timeline/ > > This adds an "acts_as" type declaration to the Models, via the file in > vendor/plugins/simile_timeline/lib/simile_timeline.rb Rails is working > with these declarations, and they are being used successfully in > ''regular Rails''. > > When I run script/backgroundrb start, I get an error saying that > method is not found (error follows sig). Backgroundrb is able to > start up with those acts_as declarations commented out. > > Presumably I need to require the plugin file somewhere, but I wondered > if backgroundrb might be meant to load the same things as Rails, by > default. > > Thanks, > James > > [james at MinistryOfInformation2]$script/backgroundrb start > /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:1532:in `method_missing'': undefined method > `acts_as_simile_timeline_event'' for #<Class:0x11655fc> (NoMethodError) > from /Users/james/Documents/University/Syracuse/Research/Dissertation/ > fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Users/james/Documents/University/Syracuse/Research/Dissertation/ > fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ > framework/packet.rb:10 > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from script/backgroundrb:16Which version of BackgrounDRb you are running? Use either trunk or 1.0.1. I remember version 1.0 has aggresive loading of models and hence you will get errors, if your model requires other plugins. But moving to 1.0.1 and trunk, I removed aggresive loading and model environment is loaded same as rails loads them. Tell me the version, I will have a look at issue. -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
James Howison
2008-Jan-22 15:14 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
On Jan 22, 2008, at 4:03 AM, hemant wrote:> Hi, > > On Jan 22, 2008 9:27 AM, James Howison <james at howison.name> wrote: >> I''m using a plugin which adds a method to ActiveRecord::Base >> >> http://similetimelinerailshelper.googlecode.com/svn/trunk/simile_timeline/ >> >> This adds an "acts_as" type declaration to the Models, via the file >> in >> vendor/plugins/simile_timeline/lib/simile_timeline.rb Rails is >> working >> with these declarations, and they are being used successfully in >> ''regular Rails''. >> >> When I run script/backgroundrb start, I get an error saying that >> method is not found (error follows sig). Backgroundrb is able to >> start up with those acts_as declarations commented out. >> >> Presumably I need to require the plugin file somewhere, but I >> wondered >> if backgroundrb might be meant to load the same things as Rails, by >> default. >> >> Thanks, >> James >> >> [james at MinistryOfInformation2]$script/backgroundrb start >> /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ >> base.rb:1532:in `method_missing'': undefined method >> `acts_as_simile_timeline_event'' for #<Class:0x11655fc> >> (NoMethodError) >> from /Users/james/Documents/University/Syracuse/Research/ >> Dissertation/ >> fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in >> `require'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:496:in `require'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:342:in `new_constants_in'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:496:in `require'' >> from /Users/james/Documents/University/Syracuse/Research/ >> Dissertation/ >> fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ >> framework/packet.rb:10 >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in >> `gem_original_require'' >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in >> `require'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:496:in `require'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:342:in `new_constants_in'' >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ >> active_support/dependencies.rb:496:in `require'' >> from script/backgroundrb:16 > > Which version of BackgrounDRb you are running? Use either trunk or > 1.0.1. > I remember version 1.0 has aggresive loading of models and hence you > will get errors, if your model requires other plugins. > But moving to 1.0.1 and trunk, I removed aggresive loading and model > environment is loaded same as rails loads them. > > Tell me the version, I will have a look at issue.Thanks. Initially I had used piston on the trunk, but now I''ve used svn:externals as in the README file: [james at MinistryOfInformation2]$svn propedit svn:externals vendor/plugins backgroundrb http://svn.devjavu.com/backgroundrb/trunk <snip> ~ ~ "svn-prop.tmp" 1L, 55C written Set new value for property ''svn:externals'' on ''vendor/plugins'' $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser [james at MinistryOfInformation2]$svn up vendor/plugins Fetching external item into ''vendor/plugins/backgroundrb'' A vendor/plugins/backgroundrb/test A vendor/plugins/backgroundrb/test/meta_worker_test.rb A vendor/plugins/backgroundrb/test/backgroundrb_test.rb A vendor/plugins/backgroundrb/test/master_worker_test.rb A vendor/plugins/backgroundrb/test/bdrb_test_helper.rb A vendor/plugins/backgroundrb/cron_trigger.patch A vendor/plugins/backgroundrb/Rakefile A vendor/plugins/backgroundrb/LICENSE A vendor/plugins/backgroundrb/tasks A vendor/plugins/backgroundrb/tasks/backgroundrb_tasks.rake A vendor/plugins/backgroundrb/TODO.org A vendor/plugins/backgroundrb/framework A vendor/plugins/backgroundrb/framework/packet_guid.rb A vendor/plugins/backgroundrb/framework/cpu_worker.rb A vendor/plugins/backgroundrb/framework/event.rb A vendor/plugins/backgroundrb/framework/packet_master.rb A vendor/plugins/backgroundrb/framework/bin_parser.rb A vendor/plugins/backgroundrb/framework/nbio.rb A vendor/plugins/backgroundrb/framework/class_helpers.rb A vendor/plugins/backgroundrb/framework/core.rb A vendor/plugins/backgroundrb/framework/buftok.rb A vendor/plugins/backgroundrb/framework/deferrable.rb A vendor/plugins/backgroundrb/framework/callback.rb A vendor/plugins/backgroundrb/framework/double_keyed_hash.rb A vendor/plugins/backgroundrb/framework/connection.rb A vendor/plugins/backgroundrb/framework/periodic_event.rb A vendor/plugins/backgroundrb/framework/io_worker.rb A vendor/plugins/backgroundrb/framework/disconnect_error.rb A vendor/plugins/backgroundrb/framework/pimp.rb A vendor/plugins/backgroundrb/framework/packet.rb A vendor/plugins/backgroundrb/framework/worker.rb A vendor/plugins/backgroundrb/framework/meta_pimp.rb A vendor/plugins/backgroundrb/README A vendor/plugins/backgroundrb/script A vendor/plugins/backgroundrb/script/backgroundrb A vendor/plugins/backgroundrb/script/bdrb_test_helper.rb A vendor/plugins/backgroundrb/init.rb A vendor/plugins/backgroundrb/config A vendor/plugins/backgroundrb/config/backgroundrb.yml A vendor/plugins/backgroundrb/server A vendor/plugins/backgroundrb/server/meta_worker.rb A vendor/plugins/backgroundrb/server/trigger.rb A vendor/plugins/backgroundrb/server/cron_trigger.rb A vendor/plugins/backgroundrb/server/invalid_dump_error.rb A vendor/plugins/backgroundrb/server/master_worker.rb A vendor/plugins/backgroundrb/server/log_worker.rb A vendor/plugins/backgroundrb/lib A vendor/plugins/backgroundrb/lib/bdrb_conn_error.rb A vendor/plugins/backgroundrb/lib/backgroundrb.rb A vendor/plugins/backgroundrb/install.rb A vendor/plugins/backgroundrb/generators A vendor/plugins/backgroundrb/generators/worker A vendor/plugins/backgroundrb/generators/worker/worker_generator.rb A vendor/plugins/backgroundrb/generators/worker/USAGE A vendor/plugins/backgroundrb/generators/worker/templates A vendor/plugins/backgroundrb/generators/worker/templates/ unit_test.rb A vendor/plugins/backgroundrb/generators/worker/templates/worker.rb A vendor/plugins/backgroundrb/MIT-LICENSE A vendor/plugins/backgroundrb/uninstall.rb A vendor/plugins/backgroundrb/examples A vendor/plugins/backgroundrb/examples/god_worker.rb A vendor/plugins/backgroundrb/examples/foo_controller.rb A vendor/plugins/backgroundrb/examples/worker_tests A vendor/plugins/backgroundrb/examples/worker_tests/ god_worker_test.rb A vendor/plugins/backgroundrb/examples/workers A vendor/plugins/backgroundrb/examples/workers/xmpp_worker.rb A vendor/plugins/backgroundrb/examples/workers/server_worker.rb A vendor/plugins/backgroundrb/examples/workers/rss_worker.rb A vendor/plugins/backgroundrb/examples/workers/world_worker.rb A vendor/plugins/backgroundrb/examples/workers/error_worker.rb A vendor/plugins/backgroundrb/examples/workers/god_worker.rb A vendor/plugins/backgroundrb/examples/workers/renewal_worker.rb A vendor/plugins/backgroundrb/examples/workers/model_worker.rb A vendor/plugins/backgroundrb/examples/workers/foo_worker.rb Updated external to revision 312. Updated to revision 339. $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser [james at MinistryOfInformation2]$svn commit -m ''added backgroundrb using externals'' Sending genrebrowser/app/models/event.rb Sending genrebrowser/vendor/plugins Transmitting file data . Committed revision 340. $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser [james at MinistryOfInformation2]$svn st ? tmp ? test/bdrb_test_helper.rb ? script/backgroundrb ? config/backgroundrb.yml ? lib/workers X vendor/plugins/backgroundrb ? vendor/plugins/acts_as_list Performing status on external item at ''vendor/plugins/backgroundrb'' $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser [james at MinistryOfInformation2]$rake backgroundrb:setup (in /Users/james/Documents/University/Syracuse/Research/Dissertation/ fromSVN/Dissertation/genrebrowser) $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser [james at MinistryOfInformation2]$script/backgroundrb start /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:1532:in `method_missing'': undefined method `acts_as_simile_timeline_event'' for #<Class:0x125bfd8> (NoMethodError) from /Users/james/Documents/University/Syracuse/Research/Dissertation/ fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Users/james/Documents/University/Syracuse/Research/Dissertation/ fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ framework/packet.rb:10 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' from script/backgroundrb:16 $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ Dissertation/genrebrowser I get the same error using the "acts_as_list" plugin, installed using script/plugin. Thanks, James ps. Perhaps the README file for installation via piston should indicate that the command is meant to be run from the vendor/plugins folder? I initially had a backgroundrb folder in my RAILS_ROOT folder.
hemant
2008-Jan-22 23:27 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
Hi, On Jan 22, 2008 8:44 PM, James Howison <james at howison.name> wrote:> > > On Jan 22, 2008, at 4:03 AM, hemant wrote: > > > Hi, > > > > On Jan 22, 2008 9:27 AM, James Howison <james at howison.name> wrote: > >> I''m using a plugin which adds a method to ActiveRecord::Base > >> > >> http://similetimelinerailshelper.googlecode.com/svn/trunk/simile_timeline/ > >> > >> This adds an "acts_as" type declaration to the Models, via the file > >> in > >> vendor/plugins/simile_timeline/lib/simile_timeline.rb Rails is > >> working > >> with these declarations, and they are being used successfully in > >> ''regular Rails''. > >> > >> When I run script/backgroundrb start, I get an error saying that > >> method is not found (error follows sig). Backgroundrb is able to > >> start up with those acts_as declarations commented out. > >> > >> Presumably I need to require the plugin file somewhere, but I > >> wondered > >> if backgroundrb might be meant to load the same things as Rails, by > >> default. > >> > >> Thanks, > >> James > >> > >> [james at MinistryOfInformation2]$script/backgroundrb start > >> /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > >> base.rb:1532:in `method_missing'': undefined method > >> `acts_as_simile_timeline_event'' for #<Class:0x11655fc> > >> (NoMethodError) > >> from /Users/james/Documents/University/Syracuse/Research/ > >> Dissertation/ > >> fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 > >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > >> `gem_original_require'' > >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > >> `require'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:496:in `require'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:342:in `new_constants_in'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:496:in `require'' > >> from /Users/james/Documents/University/Syracuse/Research/ > >> Dissertation/ > >> fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ > >> framework/packet.rb:10 > >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > >> `gem_original_require'' > >> from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > >> `require'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:496:in `require'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:342:in `new_constants_in'' > >> from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > >> active_support/dependencies.rb:496:in `require'' > >> from script/backgroundrb:16 > > > > Which version of BackgrounDRb you are running? Use either trunk or > > 1.0.1. > > I remember version 1.0 has aggresive loading of models and hence you > > will get errors, if your model requires other plugins. > > But moving to 1.0.1 and trunk, I removed aggresive loading and model > > environment is loaded same as rails loads them. > > > > Tell me the version, I will have a look at issue. > > Thanks. Initially I had used piston on the trunk, but now I''ve used > svn:externals as in the README file: > > [james at MinistryOfInformation2]$svn propedit svn:externals vendor/plugins > > backgroundrb http://svn.devjavu.com/backgroundrb/trunk > <snip> > ~ > ~ > "svn-prop.tmp" 1L, 55C written > Set new value for property ''svn:externals'' on ''vendor/plugins'' > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > [james at MinistryOfInformation2]$svn up vendor/plugins > > Fetching external item into ''vendor/plugins/backgroundrb'' > A vendor/plugins/backgroundrb/test > A vendor/plugins/backgroundrb/test/meta_worker_test.rb > A vendor/plugins/backgroundrb/test/backgroundrb_test.rb > A vendor/plugins/backgroundrb/test/master_worker_test.rb > A vendor/plugins/backgroundrb/test/bdrb_test_helper.rb > A vendor/plugins/backgroundrb/cron_trigger.patch > A vendor/plugins/backgroundrb/Rakefile > A vendor/plugins/backgroundrb/LICENSE > A vendor/plugins/backgroundrb/tasks > A vendor/plugins/backgroundrb/tasks/backgroundrb_tasks.rake > A vendor/plugins/backgroundrb/TODO.org > A vendor/plugins/backgroundrb/framework > A vendor/plugins/backgroundrb/framework/packet_guid.rb > A vendor/plugins/backgroundrb/framework/cpu_worker.rb > A vendor/plugins/backgroundrb/framework/event.rb > A vendor/plugins/backgroundrb/framework/packet_master.rb > A vendor/plugins/backgroundrb/framework/bin_parser.rb > A vendor/plugins/backgroundrb/framework/nbio.rb > A vendor/plugins/backgroundrb/framework/class_helpers.rb > A vendor/plugins/backgroundrb/framework/core.rb > A vendor/plugins/backgroundrb/framework/buftok.rb > A vendor/plugins/backgroundrb/framework/deferrable.rb > A vendor/plugins/backgroundrb/framework/callback.rb > A vendor/plugins/backgroundrb/framework/double_keyed_hash.rb > A vendor/plugins/backgroundrb/framework/connection.rb > A vendor/plugins/backgroundrb/framework/periodic_event.rb > A vendor/plugins/backgroundrb/framework/io_worker.rb > A vendor/plugins/backgroundrb/framework/disconnect_error.rb > A vendor/plugins/backgroundrb/framework/pimp.rb > A vendor/plugins/backgroundrb/framework/packet.rb > A vendor/plugins/backgroundrb/framework/worker.rb > A vendor/plugins/backgroundrb/framework/meta_pimp.rb > A vendor/plugins/backgroundrb/README > A vendor/plugins/backgroundrb/script > A vendor/plugins/backgroundrb/script/backgroundrb > A vendor/plugins/backgroundrb/script/bdrb_test_helper.rb > A vendor/plugins/backgroundrb/init.rb > A vendor/plugins/backgroundrb/config > A vendor/plugins/backgroundrb/config/backgroundrb.yml > A vendor/plugins/backgroundrb/server > A vendor/plugins/backgroundrb/server/meta_worker.rb > A vendor/plugins/backgroundrb/server/trigger.rb > A vendor/plugins/backgroundrb/server/cron_trigger.rb > A vendor/plugins/backgroundrb/server/invalid_dump_error.rb > A vendor/plugins/backgroundrb/server/master_worker.rb > A vendor/plugins/backgroundrb/server/log_worker.rb > A vendor/plugins/backgroundrb/lib > A vendor/plugins/backgroundrb/lib/bdrb_conn_error.rb > A vendor/plugins/backgroundrb/lib/backgroundrb.rb > A vendor/plugins/backgroundrb/install.rb > A vendor/plugins/backgroundrb/generators > A vendor/plugins/backgroundrb/generators/worker > A vendor/plugins/backgroundrb/generators/worker/worker_generator.rb > A vendor/plugins/backgroundrb/generators/worker/USAGE > A vendor/plugins/backgroundrb/generators/worker/templates > A vendor/plugins/backgroundrb/generators/worker/templates/ > unit_test.rb > A vendor/plugins/backgroundrb/generators/worker/templates/worker.rb > A vendor/plugins/backgroundrb/MIT-LICENSE > A vendor/plugins/backgroundrb/uninstall.rb > A vendor/plugins/backgroundrb/examples > A vendor/plugins/backgroundrb/examples/god_worker.rb > A vendor/plugins/backgroundrb/examples/foo_controller.rb > A vendor/plugins/backgroundrb/examples/worker_tests > A vendor/plugins/backgroundrb/examples/worker_tests/ > god_worker_test.rb > A vendor/plugins/backgroundrb/examples/workers > A vendor/plugins/backgroundrb/examples/workers/xmpp_worker.rb > A vendor/plugins/backgroundrb/examples/workers/server_worker.rb > A vendor/plugins/backgroundrb/examples/workers/rss_worker.rb > A vendor/plugins/backgroundrb/examples/workers/world_worker.rb > A vendor/plugins/backgroundrb/examples/workers/error_worker.rb > A vendor/plugins/backgroundrb/examples/workers/god_worker.rb > A vendor/plugins/backgroundrb/examples/workers/renewal_worker.rb > A vendor/plugins/backgroundrb/examples/workers/model_worker.rb > A vendor/plugins/backgroundrb/examples/workers/foo_worker.rb > Updated external to revision 312. > > Updated to revision 339. > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > [james at MinistryOfInformation2]$svn commit -m ''added backgroundrb using > externals'' > Sending genrebrowser/app/models/event.rb > Sending genrebrowser/vendor/plugins > Transmitting file data . > Committed revision 340. > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > [james at MinistryOfInformation2]$svn st > ? tmp > ? test/bdrb_test_helper.rb > ? script/backgroundrb > ? config/backgroundrb.yml > ? lib/workers > X vendor/plugins/backgroundrb > ? vendor/plugins/acts_as_list > > Performing status on external item at ''vendor/plugins/backgroundrb'' > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > [james at MinistryOfInformation2]$rake backgroundrb:setup > (in /Users/james/Documents/University/Syracuse/Research/Dissertation/ > fromSVN/Dissertation/genrebrowser) > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > [james at MinistryOfInformation2]$script/backgroundrb start > /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > base.rb:1532:in `method_missing'': undefined method > `acts_as_simile_timeline_event'' for #<Class:0x125bfd8> (NoMethodError) > from /Users/james/Documents/University/Syracuse/Research/Dissertation/ > fromSVN/Dissertation/genrebrowser/app/models/event.rb:9 > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Users/james/Documents/University/Syracuse/Research/Dissertation/ > fromSVN/Dissertation/genrebrowser/vendor/plugins/backgroundrb/ > framework/packet.rb:10 > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > from /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > from script/backgroundrb:16 > $~/Documents/University/Syracuse/Research/Dissertation/fromSVN/ > Dissertation/genrebrowser > > I get the same error using the "acts_as_list" plugin, installed using > script/plugin. >Looks like you are having a model called event and backgroundrb has a class called Event and hence when bdrb is trying to load event class of its own, its loading your model and its failing. Sadly to overcome this, you will have to perhaps rename your model.
Yves-Eric Martin
2008-Jan-22 23:51 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
hemant wrote:> Looks like you are having a model called event and backgroundrb has a > class called Event and hence when bdrb is trying to load event class > of its own, its loading your model and its failing. > > Sadly to overcome this, you will have to perhaps rename your modelCould changing "Event" to "Packet::Event" help bdrb load the correct class? -- Yves-Eric
James Howison
2008-Jan-23 01:21 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
On Jan 22, 2008, at 6:51 PM, Yves-Eric Martin wrote:> hemant wrote: >> Looks like you are having a model called event and backgroundrb has a >> class called Event and hence when bdrb is trying to load event class >> of its own, its loading your model and its failing. >> >> Sadly to overcome this, you will have to perhaps rename your modelI''m certainly able to change my Model names, since it''s early in the game for this application, but seems that there is a more general issue with namespaces here. Presumably the same thing would happen if I had a file matching any of the requires in packet.rb (including pimp ;)> Could changing "Event" to "Packet::Event" help bdrb load the correct > class?Seems that the issue comes from the "require ''event''" line at bdrb''s packet.rb:10 file. That line is picking up my RAILS_ROOT/app/model/ event.rb file. Changing that line to: require ''./vendor/plugins/backgroundrb/framework/event.rb'' seems to work, at least bdrb is able to start. I''m very far from really understanding Ruby''s namespaces, but the call to dbrb''s Event.new on core.rb:215 is inside a Packet module ... perhaps that will protect it. Perhaps better, though, if bdrb could be very pedantic about the namespacing it uses (either includes or full Package names for it''s internal classes, as suggested above). Maybe even a top level BDRB package for everything? Thx, James ps. Is there any smart automated way to change a Rails Model''s name, it is scattered all over the place, in files and filenames, not to mention the database?
Yves-Eric Martin
2008-Jan-23 02:20 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
James Howison wrote:> ps. Is there any smart automated way to change a Rails Model''s name, > it is scattered all over the place, in files and filenames, not to > mention the database? >Yes, it can be a real pain to rename a model. That is why the "rename your model" solution made me wince... As you pointed out, plugins should be very verbose with their namespace/paths in order to avoid conflicting with the main application. Now a small problem with require ''./vendor/plugins/backgroundrb/framework/event.rb'' is that the path is hardcoded. It could be something else (I could have checked out the plugin code into ./vendor/plugins/BackgrounDRb). I went through some other plugins code to look for best practices, and it looks like a better way to do it would be: require File.dirname(__FILE__) + ''/event'' Can you check and see if that works? -- Yves-Eric
James Howison
2008-Jan-23 02:45 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
On Jan 22, 2008, at 9:20 PM, Yves-Eric Martin wrote:> James Howison wrote: >> ps. Is there any smart automated way to change a Rails Model''s >> name, it is scattered all over the place, in files and filenames, >> not to mention the database? > > Yes, it can be a real pain to rename a model. That is why the > "rename your model" solution made me wince... > > As you pointed out, plugins should be very verbose with their > namespace/paths in order to avoid conflicting with the main > application. Now a small problem with > > require ''./vendor/plugins/backgroundrb/framework/event.rb'' > > is that the path is hardcoded. It could be something else (I could > have checked out the plugin code into ./vendor/plugins/BackgrounDRb).Indeed.> I went through some other plugins code to look for best practices, > and it looks like a better way to do it would be: > > require File.dirname(__FILE__) + ''/event'' > > Can you check and see if that works?Yes, that seems to work (bdrb starts ok), nice one. Does that take care of potential namespace issues, though, maybe still need a unique surrounding package? --J
hemant
2008-Jan-23 05:03 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
Hi, On Jan 23, 2008 7:50 AM, Yves-Eric Martin <yem_backgroundrb-devel at filter.yve.net> wrote:> James Howison wrote: > > ps. Is there any smart automated way to change a Rails Model''s name, > > it is scattered all over the place, in files and filenames, not to > > mention the database? > > > Yes, it can be a real pain to rename a model. That is why the "rename > your model" solution made me wince...Yeah, I know it sucks to rename a model, just for using a plugin.> > As you pointed out, plugins should be very verbose with their > namespace/paths in order to avoid conflicting with the main application. > Now a small problem with > > require ''./vendor/plugins/backgroundrb/framework/event.rb'' > > is that the path is hardcoded. It could be something else (I could have > checked out the plugin code into ./vendor/plugins/BackgrounDRb). I went > through some other plugins code to look for best practices, and it looks > like a better way to do it would be: > > require File.dirname(__FILE__) + ''/event'' >Okay, Its fixed now. You shouldn''t get any conflict now. You don''t need to rename the model, you don''t need need to hack the plugin. Just sync with latest trunk. I guess this solves all the problems. -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
hemant
2008-Jan-23 05:05 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
Hi James, On Jan 23, 2008 6:51 AM, James Howison <james at howison.name> wrote:> > On Jan 22, 2008, at 6:51 PM, Yves-Eric Martin wrote: > > > hemant wrote: > >> Looks like you are having a model called event and backgroundrb has a > >> class called Event and hence when bdrb is trying to load event class > >> of its own, its loading your model and its failing. > >> > >> Sadly to overcome this, you will have to perhaps rename your model > > I''m certainly able to change my Model names, since it''s early in the > game for this application, but seems that there is a more general > issue with namespaces here. Presumably the same thing would happen if > I had a file matching any of the requires in packet.rb (including > pimp ;) > > > Could changing "Event" to "Packet::Event" help bdrb load the correct > > class? > > Seems that the issue comes from the "require ''event''" line at bdrb''s > packet.rb:10 file. That line is picking up my RAILS_ROOT/app/model/ > event.rb file. > > Changing that line to: > > require ''./vendor/plugins/backgroundrb/framework/event.rb'' > > seems to work, at least bdrb is able to start.Get rid of your existing copy and sync with trunk. bdrb will no longer conflict with any of your model files.> > I''m very far from really understanding Ruby''s namespaces, but the call > to dbrb''s Event.new on core.rb:215 is inside a Packet module ... > perhaps that will protect it. Perhaps better, though, if bdrb could be > very pedantic about the namespacing it uses (either includes or full > Package names for it''s internal classes, as suggested above). Maybe > even a top level BDRB package for everything? > > Thx, > James > > ps. Is there any smart automated way to change a Rails Model''s name, > it is scattered all over the place, in files and filenames, not to > mention the database?Unless you use netbeans or something, I guess no. And please don''t rename the model if you have lots of code written around it. -- Let them talk of their oriental summer climes of everlasting conservatories; give me the privilege of making my own summer with my own coals. http://gnufied.org
hemant
2008-Jan-23 05:25 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
On Jan 23, 2008 8:15 AM, James Howison <james at howison.name> wrote:> > On Jan 22, 2008, at 9:20 PM, Yves-Eric Martin wrote: > > > James Howison wrote: > >> ps. Is there any smart automated way to change a Rails Model''s > >> name, it is scattered all over the place, in files and filenames, > >> not to mention the database? > > > > Yes, it can be a real pain to rename a model. That is why the > > "rename your model" solution made me wince... > > > > As you pointed out, plugins should be very verbose with their > > namespace/paths in order to avoid conflicting with the main > > application. Now a small problem with > > > > require ''./vendor/plugins/backgroundrb/framework/event.rb'' > > > > is that the path is hardcoded. It could be something else (I could > > have checked out the plugin code into ./vendor/plugins/BackgrounDRb). > > Indeed. > > > I went through some other plugins code to look for best practices, > > and it looks like a better way to do it would be: > > > > require File.dirname(__FILE__) + ''/event'' > > > > Can you check and see if that works? > > Yes, that seems to work (bdrb starts ok), nice one. Does that take > care of potential namespace issues, though, maybe still need a unique > surrounding package?We didn''t had namespace issues, Event class was already inside packet model so properly namespaced.
James Howison
2008-Jan-23 18:56 UTC
[Backgroundrb-devel] Unable to load Models which reference plugins?
On Jan 23, 2008, at 12:05 AM, hemant wrote:> Hi James, > > On Jan 23, 2008 6:51 AM, James Howison <james at howison.name> wrote: >> >> On Jan 22, 2008, at 6:51 PM, Yves-Eric Martin wrote: >> >>> hemant wrote: >>>> Looks like you are having a model called event and backgroundrb >>>> has a >>>> class called Event and hence when bdrb is trying to load event >>>> class >>>> of its own, its loading your model and its failing. >>>> >>>> Sadly to overcome this, you will have to perhaps rename your model >> >> I''m certainly able to change my Model names, since it''s early in the >> game for this application, but seems that there is a more general >> issue with namespaces here. Presumably the same thing would happen >> if >> I had a file matching any of the requires in packet.rb (including >> pimp ;) >> >>> Could changing "Event" to "Packet::Event" help bdrb load the correct >>> class? >> >> Seems that the issue comes from the "require ''event''" line at bdrb''s >> packet.rb:10 file. That line is picking up my RAILS_ROOT/app/model/ >> event.rb file. >> >> Changing that line to: >> >> require ''./vendor/plugins/backgroundrb/framework/event.rb'' >> >> seems to work, at least bdrb is able to start. > > Get rid of your existing copy and sync with trunk. bdrb will no longer > conflict with any of your model files.Great, the new directory structure looks to have solved the problem. Thanks. James