所需的ruby文件上的Sidekiq错误

cin*_*ani 4 ruby foreman sidekiq

我正在尝试启动我的应用程序.是独角兽+工头+ sinatra应用程序.

这是我的config.ru文件:

require "rubygems"
require "sinatra"

Bundler.require

require File.expand_path '../twitter_module.rb', __FILE__
run TwitterModule

require File.expand_path '../lib/tweet_streamer.rb', __FILE__

require 'sidekiq/web'
run Rack::URLMap.new('/' => Sinatra::Application, '/sidekiq' => Sidekiq::Web)
Run Code Online (Sandbox Code Playgroud)

这是我的sidekiq.yml:

---
:pidfile: tmp/pids/sidekiq.pid
development:
  :verbose: true
  :logfile: log/sidekiq_development.log
Run Code Online (Sandbox Code Playgroud)

这是我的Procfile:

unicorn: bundle exec unicorn -c config/unicorn.rb
sidekiq: bundle exec sidekiq -C config/sidekiq.yml -e development -r lib/workers
Run Code Online (Sandbox Code Playgroud)

现在的问题是我总是给出这个错误:

2013-10-12T15:30:23Z 28234 TID-ov4rh38wo INFO:   Please point sidekiq to a Rails 3/4 application or a Ruby file  
2013-10-12T15:30:23Z 28234 TID-ov4rh38wo INFO:   to load your worker classes with -r [DIR|FILE].
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

tir*_*xel 8

不要将lib/workers/目录指定-r为sidekiq 的选项,而是必须将其指向某个文件,该文件将处理工作人员的必要要求和设置.例如,您可能environment.rb在项目的根目录中有一个文件,需要该lib/workers/目录中的所有工作人员; 你可以用Sidekiq来指定它-r ./environment.rb.注意Sidekiq不会自己加载config.ru文件可能会有用,因为它不使用Rackup; 相反,您可能想要提取environment.rb文件或类似文件所需的任何内容,并从内部要求config.ru.