我已经安装了Que Gem,我想运行正在使用Active工作计划的任务,到目前为止,我添加了config/application.rb
config.active_job.queue_adapter = :que
,它可以正确地存储工作在数据库中,但是当我尝试运行
时rake que:work
它启动了,但是作业不起作用,我已经审查了run_at
字段,也尝试运行将ENV设置为Rails_env =开发。尝试
que ./config/application.rb
并生成和错误
I, [2016-06-15T17:30:27.592632 #30871] INFO -- : {"lib":"que","hostname":"boris-Satellite-U845","pid":30871,"thread":9851100,"event":"worker_count_change","value":"4"}
I, [2016-06-15T17:30:27.592851 #30871] INFO -- : {"lib":"que","hostname":"boris-Satellite-U845","pid":30871,"thread":9851100,"event":"mode_change","value":"async"}
/home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:109:in `connection_pool': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished)
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/adapters/active_record.rb:54:in `checkout_activerecord_adapter'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/adapters/active_record.rb:7:in `checkout'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/job.rb:85:in `work'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:80:in `block in work_loop'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:75:in `loop'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:75:in `work_loop'
from /home/boris/.rvm/gems/ruby-2.3.1@rig_cleanup/gems/que-0.11.5/lib/que/worker.rb:19:in `block in initialize'
有点迟到,但是Que要求您运行Postgres Server以工作。
我会想这就是为什么您有问题的原因。