LoginSignup
0
1

More than 5 years have passed since last update.

[Sidekiq] ローカルでSidkiqが動かなくなった時の対処方法 ~ 0から始めるRails編 ~

Posted at

ローカルでSidkiqが動かなくなった時の対処方法

エラー状態

ちなみにこのような画面のまま, プロセスが一切立ち上がらず何も処理されないままになってました。
スクリーンショット 2016-08-01 14.36.34.png

ちなみにソースと実行コマンドは以下の通りです。
実行コマンドはこちら

rails c
> HogeWorker.perform_async
app/workers/hoge_worker.rb
class HogeWorker
  include Sidekiq::Worker

  def perfor(*args)
    p "hogehoge"
  end
end
config/sidekiq.yml
:verbose: false
:pidfile: ./tmp/pids/sidekiq.pid
:logfile: ./log/sidekiq.log
:concurrency: 20
:queues:
   - default

対処方法

Gemfileの記述に問題あり!
おそらく sidekiqとrspec-sidekiqの内容が競合しているのではないかと
ということで以下のように書き直してあげるとうまく実行されるはずです。

Gemfile
group :development, :test do
  # 省略
  gem 'rspec-sidekiq', require: false # <= こいつが問題!
end 
Gemfile
group :development, :test do
  # 省略
-  gem 'rspec-sidekiq' # <= こいつが問題!
end 


group :test do
  gem 'rspec-sidekiq'
end

つぶやき

近々 ActiveJob + Sidekiqの導入方法を書こうと思います。

参考サイ

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1