我在 Rails
项目的 Gemfile
中有以下内容,但是 workless
( https://github.com/lostboy/workless ) 不工作(它不是当作业添加到 Delayed::Job
队列时启动 Heroku worker dyno。
gem 'delayed_job_active_record'
gem 'workless'
gem 'daemons'
最佳答案
不幸的是,这是一个静默错误,所以我花了很长时间才弄明白。
As per the gem's instructions : 将您的 Heroku 应用程序名称/API key 作为配置变量添加到您的 Heroku 实例。
heroku config:add HEROKU_API_KEY=yourapikey APP_NAME=yourherokuappname
从https://dashboard.heroku.com/account获取yourapikey
和来自 https://dashboard.heroku.com/apps 的 yourherokuappname
此外,如果您使用的是 Procfile要声明Heroku 平台上您的应用程序的测功机运行什么命令,不需要 worker
行(worker: bundle exec rake jobs:work
) in Procfile
-- 只有当您不使用workless
时才需要。
关于ruby-on-rails - workless 不工作(它没有启动 Heroku worker dyno),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16806367/