1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Rails】NameError: uninitialized constant Sidekiq::Loggingの解決方法【非同期処理】

Posted at

#はじめに
現場で使える Ruby on Rails 5速習実践ガイド
「Chapter 7-8 非同期処理や定期実行を行う」でタイトルのエラーが発生。
タスク管理アプリのタスクフォームからタスクを投稿した時に非同期処理が実行されるプログラムを記述するも想定通りいかず、、、
#環境
Ruby 2.6.6
Rails 6.1.3
sidekiq 6.0.4
#結論
sidekiqのバージョンが新し過ぎたせいでコマンドがうまく実行されなかった模様。
なので、以下をgemfileに記載。

gemfile
gem 'sidekiq', '~> 5.0'

記入後bundleからのrails sの後にredis-serverとbundle exec sidekiqを実行。
タスク投稿後、無事出力された。

2021-03-19T15:05:18.659Z 10221 TID-ovjc2wymp SampleJob JID-82b7b80cec1cd3c40b4592ec INFO: start
2021-03-19T15:05:18.845Z 10221 TID-ovjc2wymp SampleJob JID-82b7b80cec1cd3c40b4592ec INFO: サンプルジョブを実行しました
2021-03-19T15:05:18.846Z 10221 TID-ovjc2wymp SampleJob JID-82b7b80cec1cd3c40b4592ec INFO: done: 0.187 sec

参考:teratail:NameError: uninitialized constant Sidekiq::Loggingの解決方法

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?