怒られたのでメモ
環境
sidekiq (5.0.0)
実例
下記のように書くとご丁寧にオプション付きで -r をつけろ
と怒られる
$ /home/washi/example_app/bin/bundle exec sidekiq 2019-09-04T00:10:14.527Z 26140 TID-gqpwpb3so INFO: ================================================================== 2019-09-04T00:10:14.527Z 26140 TID-gqpwpb3so INFO: Please point sidekiq to a Rails 3/4 application or a Ruby file 2019-09-04T00:10:14.527Z 26140 TID-gqpwpb3so INFO: to load your worker classes with -r [DIR|FILE]. 2019-09-04T00:10:14.527Z 26140 TID-gqpwpb3so INFO: ================================================================== INFO: sidekiq [options] -c, --concurrency INT processor threads to use -d, --daemon Daemonize process -e, --environment ENV Application environment -g, --tag TAG Process tag for procline -i, --index INT unique process index on this machine -q, --queue QUEUE[,WEIGHT] Queues to process with optional weights -r, --require [PATH|DIR] Location of Rails application with workers or file to require -t, --timeout NUM Shutdown timeout -v, --verbose Print more verbose output -C, --config PATH path to YAML config file -L, --logfile PATH path to writable logfile -P, --pidfile PATH path to pidfile -V, --version Print version and exit -h, --help Show help $
ヘルプ通り、RailsのRootを指定すればいいので、指定してあげる
$ /home/washi/example_app/bin/bundle exec sidekiq -r /home/washi/example_app/
余談
なお、Demonizeする --daemon
と組み合わせるとエラーが出たが、環境依存かどうかは不明。。