简体   繁体   English

Heroku:使用回形针运行imagemagick

[英]Heroku: Running imagemagick with paperclip

I have installed image magick on my mac os x computer and now I want to deploy it to heroku. 我在我的mac os x计算机上安装了image magick,现在我想将它部署到heroku。 I've installed the the paperclip plugin on heroku but I get this error when uploading an image: 我在heroku上安装了paperclip插件,但上传图片时出现此错误:

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? 之前我在计算机上没有imagemagick instaledl时出现此错误,但现在我想部署它, 如何让图像magick在heroku上工作?

Do you have the RMagick gem included in your app on Heroku? 您是否在Heroku的应用程序中包含RMagick gem? It's necessary for interfacing between your Ruby code and ImageMagick. 在Ruby代码和ImageMagick之间进行接口是必要的。

ImageMagick is part of the Heroku platform by default, but you have to specify that you need the RMagick gem for your app. 默认情况下,ImageMagick是Heroku平台的一部分,但您必须指定您的应用需要RMagick gem。 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). 我猜你已经在本地安装了它,所以它可以在那里工作,但是你的Gemfile或gems清单中缺少它(取决于Heroku堆栈版本)。

Try to remove the Paperclip.options[:command_path] = "/path/to/" when deploying to heroku. 在部署到heroku时,尝试删除Paperclip.options [:command_path] =“/ path / to /”。

This solved the issue for me. 这解决了我的问题。

Add the following to your gemfile... 将以下内容添加到您的gemfile中......

gem 'rmagick' 宝石'rmagick'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM