uninitialized constant sidekiq worker

I didn't have spring installed so I took the lazy approach and turned on eager loading in my config/environments/development.rb file:

config.eager_load = true

and then turned it back to false after restarting my server.


By default, Rails will include all subdirectories of the app folder in the autoload paths list. You can review the list of autoload paths in the console with:

puts ActiveSupport::Dependencies.autoload_paths

But Rails only looks for these paths at boot time. So when you add a new folder, like app/workers, it is not enough to restart the Rails console. You need to both exit the Rails console and stop the Spring Application Preloader with:

spring stop

Then start up the Rails console again and the files in the app/workers folder will load properly.