ruby - Rails eventmachine not initialized evma_install_oneshot_timer -
i'm using rails 4.1.1
, thin 1.6.2
, redis 2.8.9
(with hiredis
driver), , faye-rails
gem.
i use faye-rails
subscribe changes on few models, , use redis
other (unrelated) stuff.
when tried call create
on faye-observed
model (let's apple), throws error this:
2.1.1 :001 > apple.create (0.1ms) begin sql (0.4ms) insert `apples` (`created_at`, `updated_at`) values ('2014-06-01 17:26:54', '2014-06-01 17:26:54') (7.6ms) rollback runtimeerror: eventmachine not initialized: evma_install_oneshot_timer /home/david/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:323:in `add_oneshot_timer' /home/david/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/eventmachine.rb:323:in `add_timer' /home/david/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/em/timers.rb:12:in `initialize' /home/david/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/em/deferrable.rb:173:in `new' /home/david/.rvm/gems/ruby-2.1.1/gems/eventmachine-1.0.3/lib/em/deferrable.rb:173:in `timeout' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/envelope.rb:11:in `initialize' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:357:in `new' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:357:in `transport_send' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:346:in `block in send' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/extensible.rb:23:in `call' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/extensible.rb:23:in `pipe_through_extensions' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:343:in `send' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:92:in `handshake' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:131:in `connect' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-1.0.1/lib/faye/protocol/client.rb:270:in `publish' /home/david/.rvm/gems/ruby-2.1.1/gems/faye-rails-2.0.0/lib/faye-rails/controller.rb:45:in `publish' ... 27 levels... /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/transactions.rb:208:in `transaction' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/transactions.rb:326:in `with_transaction_returning_status' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/transactions.rb:268:in `block in save' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/transactions.rb:283:in `rollback_active_record_state!' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/transactions.rb:267:in `save' /home/david/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.1/lib/active_record/persistence.rb:34:in `create' (irb):1 /home/david/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/console.rb:90:in `start' /home/david/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/console.rb:9:in `start' /home/david/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:69:in `console' /home/david/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!' /home/david/.rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>' bin/rails:4:in `require' bin/rails:4:in `<main>'
notice runtimeerror: eventmachine not initialized: evma_install_oneshot_timer
.
the error alternates between that, , argumenterror: wrong number of arguments (0 2..3)
.
after time digging, error occurs when i'm trying save observed model.
any gladly appreciated.
i use code faye
$faye = faye::client.new('http://localhost/faye') class wrapper def self.publish(text) run_event_machine $faye.publish("/base", text) end def self.run_event_machine thread.new { em.run } unless em.reactor_running? thread.pass until em.reactor_running? end end
and when needs send data just:
wrapper.publush("the truth out there")
Comments
Post a Comment