1

我已经安装了que gem,我想运行我正在安排的任务,目前我已经添加了config/application.rb

config.active_job.queue_adapter = :que

并将作业正确存储在数据库中但是当我尝试运行时

rake que:work

它开始但工作不工作,我已经审查了run_at现场,还尝试将环境设置为 RAIls_ENV=development。试过了

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'
4

1 回答 1

0

有点晚了,但是 Que 要求您运行 Postgres 服务器才能正常工作。

我想这就是你遇到问题的原因。

于 2016-07-17T17:52:55.313 回答