在Heroku的种子图像与回形针(Seed images in heroku with paperc

2019-08-17 00:51发布

当我运行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.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'

Answer 1:

找到解决方案。

THX 这

与此

与此

宝石 'AWS-SDK'



文章来源: Seed images in heroku with paperclip