Heroku上的Ruby守护进程

我正在尝试在Heroku上执行ruby守护程序无框架应用程序,但在尝试执行worker之后崩溃:

heroku[worker.1]: State changed from crashed to starting heroku[worker.1]: Starting process with command `bundle exec rake twitter:start` heroku[worker.1]: State changed from starting to up heroku[worker.1]: Process exited with status 0 heroku[worker.1]: State changed from up to crashed 

该应用程序基本上通过一堆API收集数据,并将其保存在远程MongoHQ实例上。

佣金任务是:

 dir_path = File.expand_path('../', __FILE__) namespace :twitter do desc 'Start Twitter daemon' task :start do exec "#{dir_path}/bin/autana start" end ... end 

Procfile很简单: worker: bundle exec rake twitter:start

执行守护程序的代码如下:

 #!/usr/bin/env ruby require 'daemons' require File.expand_path('../../lib/autana', __FILE__) Daemons.run_proc('autana', multiple: true, no_pidfiles: true) do client = Autana::Client::Twitter.new client.collect end 

有任何想法吗?

你能动态运行吗?

 heroku run rake twitter:start 

所以,这是一个MongoDB错误。 数据没有正确关联。 进入控制台后,并更改了文档,一切都按预期工作。