2012-10-05 79 views
2

我正在從遷移到Mongoid,這個回形針的東西用來正常工作。我正在使用Ubuntu 12.04mongoid-paperclip:照片不被'識別'命令識別

我有了這個代碼,我mongoid文件:

has_mongoid_attached_file :photo, 
    :styles => { 
    :thumb => "60x60", 
    :small => "100x100", 
    :medium => "300x200", 
    :large => "600x400" 
    }, 
    :storage => :s3, 
    :s3_credentials => "#{Rails.root}/config/s3.yml", 
    :path => "#{Rails.env}/merc:attachment/:id/:style.:extension", 
    :url => ":s3_alias_url", 
    :bucket => '%^&*&^' 

我有rmagick寶石安裝和command_path指着其中各種ImageMagick的命令 - > '在/ usr/bin' 的。

我使用獨角獸作爲我的網絡服務器,而我已經驗證identiy和轉換都可以通過把這個在我看來:

<%= `which convert` %> 
<%= `echo $PATH` %> 

但很可惜,當我嘗試上傳的圖片我獲得:

Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is not recognized by the 
'identify' command. Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is not 
recognized by the 'identify' command. Photo 
/tmp/qdoba20121005-27609-1m3kq9c.jpg is not recognized by the 
'identify' command. Photo /tmp/qdoba20121005-27609-1m3kq9c.jpg is 
not recognized by the 'identify' command. 

對於我定義的每種樣式都有一種。

我已確認該文件存在,並且我可以從命令行運行識別文件。

任何幫助將不勝感激。謝謝!

回答

2

最近更新的可卡因寶石打破了很多人的imagemagick文件名 - 檢查出來,因爲回滾可卡因到以前的版本可能會有所幫助。

在這裏看到:

https://github.com/thoughtbot/paperclip/issues/1038

+0

那是完全正確的!添加寶石'可卡因','0.3.2'解決了這個問題。 –

+0

良好的通話,我最近升級了所有的寶石,並遇到同樣的問題。 – Noz