Heroku: Running imagemagick with paperclip

丶灬走出姿态 提交于 2019-11-30 11:04:00

问题


I have installed image magick on my mac os x computer and now I want to deploy it to heroku. I've installed the the paperclip plugin on heroku but I get this error when uploading an image:

Paperclip::CommandNotFoundError

I had this error before when I didn't have imagemagick instaledl on my computer before but now that I want to deploy it, how do I get image magick to work on heroku?


回答1:


Do you have the RMagick gem included in your app on Heroku? It's necessary for interfacing between your Ruby code and ImageMagick.

ImageMagick is part of the Heroku platform by default, but you have to specify that you need the RMagick gem for your app. I'm guessing you have this installed locally so it works there, but it's missing from your Gemfile or gems manifest (depending on Heroku stack version).




回答2:


Try to remove the Paperclip.options[:command_path] = "/path/to/" when deploying to heroku.

This solved the issue for me.




回答3:


Add the following to your gemfile...

gem 'rmagick'



来源:https://stackoverflow.com/questions/3963892/heroku-running-imagemagick-with-paperclip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!