简体   繁体   English

使用delay_paperclip宝石和delay_job宝石

[英]using delayed_paperclip gem with delayed_job gem

i am working on a simple rails project and i use paperclip to upload attachments but when ever i use delayed job gem with delayed_paperclip gem i dont see the attachment. 我正在一个简单的Rails项目中工作,我使用回形针上传附件,但是每当我将延迟的工作Gem与delay_paperclip的宝石一起使用时,我都看不到附件。 I followed the rdoc and tried it out but my guess is that i am not running delayed job well. 我遵循了rdoc并进行了尝试,但我猜想我的延误工作没有做好。

my attachment.rb lookes like this 我的attach.rb看起来像这样

has_attached_file :file
process_in_background :file

and i added this to my database 并将其添加到我的数据库中

class AddFileProessingToAttachments < ActiveRecord::Migration
  def change
    add_column :attachments, :file_processing, :boolean
  end
end

what else do i need to do again because i have waited for a long time and i still have a missing file. 我还需要再做什么,因为我已经等了很长时间了,但是仍然缺少文件。

I just realized that i have to start the delayed job task with the following command. 我只是意识到我必须使用以下命令启动延迟的工作任务。

rake jobs:work

did not know until i checked my list of rake tasks 直到我检查了耙任务列表才知道

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM