用回形针在heroku种子图像

时间:2013-02-19 03:05:04

标签: ruby-on-rails ruby heroku paperclip seed

当我运行heroku run rake db:seed时,我得到了

Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/image20130219-2-1gk1yip.png[0]'
Command :: composite -gravity Center /app/public/media/watermark.png "/tmp/image20130219-2-1gk1yip.png[0]" -resize "1x1<" "/tmp/image20130219-2-1gk1yip.png20130219-2-1ng5f6c[0]"
Command :: file -b --mime '/tmp/image20130219-2-1gk1yip.png20130219-2-1ng5f6c'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1ng5f6c[0]'
Command :: convert "/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1ng5f6c[0]" -resize "260x190" "/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1mz0u16[0]"
Command :: file -b --mime '/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1mz0u16'
[paperclip] Saving attachments.

我得到了我的Stuff和有效的db记录,但是在公共文件夹中没有重新创建图像..如果我通过视图形式添加图像一切都很好。

我的种子

Stuff.create! title: 'title', description: 'desc', :img => File.open(File.join(Rails.root, '/db/seeds/image.png'))

的Gemfile

gem 'json'
gem 'haml-rails'
gem 'sass-rails'
gem 'coffee-rails'
gem 'rails_autolink'
gem 'formtastic'
gem 'paperclip'
gem 'rmagick', '2.12.0'
gem 'pg'
gem 'uglifier'

1 个答案:

答案 0 :(得分:3)

找到解决方案。

thx this

this

this

  

gem'aws-sdk'