Unsupported command argument type: Resque::Worker

176 Views Asked by At

Im attempting to run resque for a rails 7 app on my machine like this: QUEUE=* bundle exec rake resque:work

It fails with this:

rake aborted!
TypeError: Unsupported command argument type: Resque::Worker
Original Exception (TypeError): Unsupported command argument type: Resque::Worker

Original Exception (Resque::PruneDeadWorkerDirtyExit): Worker Davids-Mac-mini:38378:* did not gracefully exit while processing <Unknown Job>

I am sure redis-server is running correctly

This is my setup

application.rb

config.active_job.queue_adapter = :resque

config/initializers/resque.rb

require 'resque/server'

if Rails.env.development?
  Resque.redis = Redis.new(host: 'localhost', port: '6379')
else
  uri = URI.parse(ENV['REDIS_URL'])
  REDIS = Redis.new(host: uri.host, port: uri.port, password: uri.password)
  Resque.redis = REDIS
end

application_job.rb

class ApplicationJob < ActiveJob::Base
  # Automatically retry jobs that encountered a deadlock
  # retry_on ActiveRecord::Deadlocked

  # Most jobs are safe to ignore if the underlying records are no longer available
  # discard_on ActiveJob::DeserializationError
end

schedules_job.rb

class SchedulesJob < ApplicationJob 
  queue_as :default

  def perform(id)
    puts 'Hello world!'
  end
end

Rakefile

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'
require 'resque'
require 'resque/tasks'

task 'resque:setup' => :environment

Rails.application.load_tasks
0

There are 0 best solutions below