簡體   English   中英

Paperclip 2.3.5中的錯誤重新處理

[英]Error reprocessing in Paperclip 2.3.5

我將字符串數組錯誤從2.3.3更新到2.3.5,現在當我嘗試調用Model.image.reprocess時! 我收到以下錯誤。 這在我的代碼中還是在回形針中? 還是在我上傳的圖片中?

"\xFF" from ASCII-8BIT to UTF-8
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/paperclip-2.3.5/lib/paperclip/storage/s3.rb:134:in `to_file'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/paperclip-2.3.5/lib/paperclip/attachment.rb:219:in `reprocess!'
/home/brian/Dropbox/portfolio/app/models/asset.rb:34:in `regenerate_styles!'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/performable_method.rb:20:in `perform'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/backend/base.rb:77:in `invoke_job'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:118:in `block (2 levels) in run'
/home/brian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/timeout.rb:57:in `timeout'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:118:in `block in run'
/home/brian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:117:in `run'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:176:in `reserve_and_run_one_job'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:102:in `block in work_off'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:101:in `times'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:101:in `work_off'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:76:in `block (2 levels) in start'
/home/brian/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:75:in `block in start'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:72:in `loop'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/worker.rb:72:in `start'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:100:in `run'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:79:in `block in run_process'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/application.rb:250:in `call'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/application.rb:250:in `block in start_proc'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/daemonize.rb:199:in `call'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/daemonize.rb:199:in `call_as_daemon'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/application.rb:254:in `start_proc'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/application.rb:294:in `start'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/controller.rb:70:in `run'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons.rb:193:in `block in run_proc'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `call'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons/cmdline.rb:112:in `catch_exceptions'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/gems/daemons-1.1.0/lib/daemons.rb:192:in `run_proc'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:78:in `run_process'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:72:in `block in daemonize'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:70:in `times'
/home/brian/.rvm/gems/ruby-1.9.2-p0@sp/bundler/gems/delayed_job-aba9905764c2/lib/delayed/command.rb:70:in `daemonize'
script/delayed_job:5:in `<main>'

相關型號:

class Asset < ActiveRecord::Base
  attr_accessible :image, :image_file_name, :image_content_type, :image_file_size, :portfolio_item_id, :order

  belongs_to :portfolio_item

  has_attached_file :image,
    :styles => {
      :thumb => "20x20#",
      :small => "100x100",
      :large => "600x600>"
               },
    :storage => :s3,
    :s3_credentials => {
      :access_key_id => ENV["S3_KEY"],
      :secret_access_key => ENV["S3_SECRET"]
                       },
    :bucket => ENV["S3_BUCKET"],
    :path => "portfolio/:attachment/:id/:style/:basename.:extension"

  before_image_post_process do |image|
    if changed?
      processing = true
      false
    end
  end

  after_save do |image|
    if image.changed?
      send_later(:regenerate_styles!)
    end
  end

  def regenerate_styles!
    self.image.reprocess!
    self.processing = false
    self.save(false)
  end

  def changed?
    self.image_file_size_changed? ||
    self.image_file_name_changed? ||
    self.image_content_type_changed? ||
    self.image_update_at_changed?
  end
end

回形針是一個錯誤。 恢復到以前的版本,您就可以了。 這確實讓我也拉了幾天頭發。 :)

沒有答案,只是確認我有同樣的問題。 我在Rails 3上並嘗試使用Paperclip 2.3.5、2.3.4和2.3.3都無濟於事,在調用reprocess時,與@ Reactor5保持相同的錯誤

有任何想法嗎?

編輯我研究了這一點。 Paperclip和Ruby 1.9.2似乎是一個問題,但仍然不知道是什么原因導致的,但是切換到Ruby 1.8.7可以為我解決這個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM