19

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
devinross
  • 2,816
  • 6
  • 34
  • 34

3 Answers3

30

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).

tfe
  • 32,666
  • 2
  • 27
  • 24
  • what do i need to do for the rmagick gem? i'm running the stack "bamboo-ree-1.8.7" – devinross Oct 18 '10 at 22:35
  • You'll also want to make sure you include it in your Rails app, however your version of rails specifies gem dependencies (`config.gem` command in `config/environment.rb` for Rails 2.x). – tfe Oct 18 '10 at 22:44
  • i'm using rails 3.0, what do i have to do for that version? thanks – devinross Oct 18 '10 at 22:51
  • I've not yet used Rails 3 personally, but I believe it just loads all the gems listed in your `Gemfile`. – tfe Oct 19 '10 at 00:59
  • 3
    @tfe: "ImageMagick is part of the Heroku platform by default". That's great to know, but I wonder: Where is this documented? I've been looking around in the documentation but have seen no reference to this fact. Makes me wonder what else is part of the platform... – Felixyz Nov 16 '10 at 19:22
  • 2
    @Felixyz: Yeah, that's a very good point. Really, the platform is still in its infancy (well, maybe a little more than that... adolescence?) so is still changing rapidly. There are some docs but they are nowhere near as comprehensive as they should be. Most of what I know has come from years of having production apps deployed on it, since the very early private beta days. – tfe Nov 22 '10 at 03:01
  • Side note: The bamboo stack is deprecated now. – StackExchange User Mar 23 '13 at 19:35
8

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

This solved the issue for me.

thormarius
  • 81
  • 1
  • 1
  • 1
    I had the :command_path option set in my environment.rb file, which was causing problems. Moved that option to development and test environments specifically (not production), and it's working fine for me now on Heroku. Thanks! – jasonmklug Jul 08 '11 at 19:16
  • So you don't need anything for production? I tried uploading a gif file on heroku and got a processing error. It worked on development – Keith Mattix Jun 20 '12 at 11:11
3

Add the following to your gemfile...

gem 'rmagick'

jmontross
  • 3,533
  • 1
  • 21
  • 17