Skip to content

Instantly share code, notes, and snippets.

@oki
Created December 2, 2009 09:04
Show Gist options
  • Select an option

  • Save oki/247066 to your computer and use it in GitHub Desktop.

Select an option

Save oki/247066 to your computer and use it in GitHub Desktop.
michalkurek@nil ~/rails/messge_monster $ ./script/about
Ruby version 1.8.6 (i686-darwin9.8.0)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.4
Active Record version 2.3.4
Active Resource version 2.3.4
Action Mailer version 2.3.4
Active Support version 2.3.4
Environment development
Database adapter mysql
Error:
michalkurek@nil ~/rails/messge_monster $ ./script/poller run
ActiveMessaging: Loading /Users/michalkurek/rails/messge_monster/app/processors/application.rb
ActiveMessaging: Loading /Users/michalkurek/rails/messge_monster/app/processors/hello_world_processor.rb
=> Subscribing to /queue/HelloWorld (processed by HelloWorldProcessor)
Dispatch exception: undefined method `prepare_application_for_dispatch' for ActionController::Dispatcher:Class
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:192:in `prepare_application'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:205:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:203:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:203:in `dispatch'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:45:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:32:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:31:in `each'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging/gateway.rb:31:in `start'
/usr/local/lib/ruby/gems/1.8/gems/activemessaging-0.6.1/lib/activemessaging.rb:114:in `start'
/Users/michalkurek/rails/messge_monster/lib/poller.rb:25
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:176:in `start_load'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/application.rb:253:in `start'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/controller.rb:72:in `run'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:139:in `run'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `call'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons/cmdline.rb:105:in `catch_exceptions'
/usr/local/lib/ruby/gems/1.8/gems/daemons-1.0.10/lib/daemons.rb:138:in `run'
./script/poller:25
^C
<<Interrupt received>>
Solution:
Create initializer for active_messaging contain:
# file config/initializers/active_messaging.rb
module ActiveMessaging
mattr_accessor :cache_classes
self.cache_classes = true
class Gateway
def self.prepare_application
Dispatcher.prepare_application_for_dispatch unless ActiveMessaging.cache_classes
end
def self.reset_application
Dispatcher.reset_application_after_dispatch unless ActiveMessaging.cache_classes
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment