Create an excel in delayed job method using axlsx
I am trying to generate an excel file in my delayed job method in model. which is working fine in local. i'm using scheduler to run delayed jobs in heroku. Jobs are getting finished successfully without generating excel. my delayed job method looks like: def self.generate_excel Axlsx::Package.new do |p| p.workbook.add_worksheet(:name => "Stock Details") do |sheet| sheet.add_row ["S.No", "ProductId", "Title"] products.each_with_index do |prods, index| sheet.add_row ["1", "1234", "product title"] end end p.serialize("#{Rails.root}/app/views/stock_details/stock_details.xlsx") end I'm using