开发者

Error resizing images with Paperclip after images have been added

开发者 https://www.devze.com 2023-03-06 07:04 出处:网络
This is the code in my model: has_attached_file :photo, :styles => { :tiny => \"25x25#\", :t开发者_开发技巧humbnail => \"50x50#\",

This is the code in my model:

has_attached_file :photo,
  :styles => {
    :tiny => "25x25#",
    :t开发者_开发技巧humbnail => "50x50#",
    :small  => "150x150>",
    :medium => "300x300>" },
    :default_url => "/images/default_:style.jpg"

I run this command:

rake paperclip:refresh:thumbnails CLASS=Photo

and I get this error:

rake aborted!
uninitialized constant Photo

What going on? How can I fix this?


Obviously it doesn't know your model Photo. Try a command "require", e.g.

require "lib/photo"

or whatever your model path is.

0

精彩评论

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