しばらくの間、Paperclip を使用してレールをインストールしましたが、最近のデプロイで壊れました。マシン上で他に何も変更されていないため、gemfile の更新と一致したと思います。エラーは次のとおりです。
Command :: file -b --mime :file
[paperclip] Error while determining content type: Command 'file -b --mime :file' returned 1. Expected 0
これは、有効であることが確認された png ファイルにあります。イメージで「file -b --mime」を実行すると、次のようになります。
image/png; charset=binary
私も後でこれを取得します:
Command :: identify -format %wx%h :file
[paperclip] An error was received while processing: #<Paperclip::Errors::NotIdentifiedByImageMagickError: /tmp/song_waveform_3010520121008-23335-165xag4.png20121008-23335-j8e18p is not recognized by the 'identify' command.>
which ファイルを実行すると /usr/bin が得られたので、変更なしで production.rb に Paperclip.options[:command_path] = "/usr/bin/" を設定してみました。
なぜこれが起こっているのか、私には考えられません。おそらく、正しいディレクトリを指していないのでしょうか? 私はここで少し迷っています。