Windows 7でRuby 1.8.7とRails 2.3.5を実行しています。私は、Webアプリケーションで画像をアップロードPaperclipError、 "サムネイルの処理中にエラーが発生しました..."
(私が書かれていない)私はこのエラーを取得する:
[paperclip] identify -format %wx%h "C:/Windows/Temp/stream20110104-3660-1j1ap8i-0.jpg[0]" 2>NUL
[paperclip] convert "C:/Windows/Temp/stream20110104-3660-1j1ap8i-0.jpg[0]" -resize "100x140>" "C:/Windows/Temp/stream20110104-3660-1j1ap8i-020110104-3660-rmkivh-0" 2>NUL
[paperclip] An error was received while processing: There was an error processing the thumbnail for...
私はそれが動作CMDシェルに変換-コマンドをしようとします。 私は2つの仮想マシンとサーバー(すべてのWin 7)にWebアプリケーションをインストールし、どこにでもエラーを取得しました。
同じ構成の別のPC(Win 7も同様)で動作しますが、正常です。
この問題の原因が分かっていますか?
これは、このエラーを生成しますthumbnail.rbのコードです:
# Performs the conversion of the +file+ into a thumbnail. Returns the Tempfile
# that contains the new image.
def make
src = @file
dst = Tempfile.new([@basename, @format ? ".#{@format}" : ''])
dst.binmode
begin
parameters = []
parameters << source_file_options
parameters << ":source"
parameters << transformation_command
parameters << convert_options
parameters << ":dest"
parameters = parameters.flatten.compact.join(" ").strip.squeeze(" ")
success = Paperclip.run("convert", parameters, :source => "#{File.expand_path(src.path)}[0]", :dest => File.expand_path(dst.path))
rescue PaperclipCommandLineError => e
raise PaperclipError, "There was an error processing the thumbnail for #{@basename}" if @whiny
end
dst
end
はい、はいのどこかのImageMagickへのパスを定義することができます。私は、うまく動作したシェルのログと同じ変換コマンドを試しました。 – Hedge