Skip to content

Instantly share code, notes, and snippets.

@mattbeedle
Created August 27, 2009 18:32
Show Gist options
  • Save mattbeedle/176465 to your computer and use it in GitHub Desktop.
Save mattbeedle/176465 to your computer and use it in GitHub Desktop.
# environment.rb
config.after_initialize do
Qusion.start
Workling::Remote.invoker = Workling::Remote::Invokers::EventmachineSubscriber
Workling::Remote.dispatcher = Workling::Remote::Runners::ClientRunner.new
Workling::Remote.dispatcher.client = Workling::Clients::AmqpClient.new
end
# I have an after_save in my location model which tries to use workling to geocode
# a location with this line
GeocodingWorker.async_geocode(:id => id, :klass => self.class.to_s)
# In passenger after installing qusion (http://github.com/danielsdeleo/qusion/tree/master) the code
# seems to work, but in script/console:
Location.find(9).update_attributes :locality => "Berlin", :region => nil, :postal_code => '10963'
Workling::WorklingError: couldn't start amq client. if you're running this in a server environment, then make sure the server is evented (ie use thin or evented mongrel, not normal mongrel.)
from /home/matt/Websites/mysite/vendor/plugins/workling/lib/workling/clients/amqp_client.rb:16:in `connect'
from /home/matt/Websites/mysite/vendor/plugins/workling/lib/workling/remote/runners/client_runner.rb:36:in `run'
from /home/matt/Websites/mysite/vendor/plugins/workling/lib/workling/remote.rb:38:in `run'
from /home/matt/Websites/mysite/vendor/plugins/workling/lib/workling/base.rb:53:in `method_missing'
from /home/matt/Websites/mysite/lib/geocodable.rb:21:in `geocode'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `send'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `evaluate_method'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:166:in `call'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:93:in `run'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `each'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `send'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `run'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:276:in `run_callbacks'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:344:in `callback'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:251:in `create_or_update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2539:in `save_without_validation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:1009:in `save_without_dirty'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/dirty.rb:79:in `save_without_transactions'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:182:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2628:in `update_attributes'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment