开发者

ImageMagick and Paperclip on Rails only accepts bmp file

I'm trying to set up a rails app with paperclip and ImageMagick on Ubunutu 10.10, I have managed to make it work but only with bmp files, when i try to upload any other kind of file I get the error:

Image Paperclip::CommandNotFoundError
Image Paperclip::CommandNotFoundError

I thought it had something to do with ImageMag开发者_运维知识库ic so I found this old tutorial

http://www.randycullom.com/chatterbox/archives/2006/12/installing_imag.html

So I uninstall ImageMagick, installed jpg,tiff and png libraries, on jgp library I used

./configure --enable-shared ...

And then install ImageMagic with configure

./configure --enable-lzw=yes --enable-shared=yes --disable-static --without-perl make sudo make install

and the error still apears, on my enviroment.rb I have

Paperclip.options[:command_path] = "/usr/local/bin/"

Which is the path than running 'which convert' gave me, on gem file:

gem "paperclip", "~> 2.3" gem 'rmagick'

What am I missing? Help would be much appreciated.


On Ubuntu, you can usually safely intall ImageMagick via apt-get (or aptitude). Normally I do:

sudo apt-get install imagemagick
sudo apt-get install libmagick9-dev [deprecated]
sudo gem install rmagick

Edited

use instead of libmagick9-dev

sudo apt-get install graphicsmagick-libmagick-dev-compat


Update from @bartuzz comment

Ubuntu 14.04: sudo apt-get install libmagickcore-dev libmagickwand-dev


Following on from the other answers (@Callmeed, @arturtr), for Ubuntu 14.04

sudo apt-get install imagemagick
sudo apt-get install graphicsmagick-libmagick-dev-compat
sudo apt-get install libmagickcore-dev libmagickwand-dev

worked for me, but installing rmagick without the sudo

gem install rmagick


Ubuntu 16.04: sudo apt-get -y install imagemagick libmagickcore-dev libmagickwand-dev

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜