how to run rails commands in system command in rails when we run through delayed jobs?

112 views Asked by At
def process_order
  OrderProcess.delay(run_at:1.minutes.from_now).processing_order(params[:id])
    redirect_to '/'
end

when process_order is executed it will execute delayed job

class OrderProcess
  def self.processing_order(order_id)
    system("rails generate controller welcome index")
  end
end

when we remove delay(run_at:1.minutes.from_now) and process_order then rails commands in system command are getting executed but when we run through delayed job rails commands are not getting executed

thanks in advance

0

There are 0 answers