简体   繁体   中英

Uploading an image file with Paperclip (in RoR) causing error

This should be a simple thing to do, but I'm running into a wall and I'm not sure how to debug this response.

In my Image model, I have:

class Image < ActiveRecord::Base
  has_attached_file :image, :styles => {  :display => "500x500>",
                                          :thumbnail => "95x95>"}

Then in my Views, my form contains this:

-form_for @image, :html => { :multipart => true } do |image|
    %tr
      %td.woc_left
        =label_tag :image, 'photo to upload', :class => 'required'
      %td.woc_center
        =image.file_field :image

In my Mysql table, I have a column called "image_file_name" (string).

However, when I try to upload an image and submit it, I see

2 errors prohibited this from being saved
There were problems with the following fields:
Image Paperclip::CommandNotFoundError
Image Paperclip::CommandNotFoundError

What am I doing wrong? Thank you for your help!

Paperclip relies on external tools to resize the images. It looks like you either don't have the tools installed or they are not found.

I've used ImageMagick but other tools may be usable by Paperclip.

Which environment are you running on?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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