用回形针在heroku种子图像 [英] Seed images in heroku with paperclip
本文介绍了用回形针在heroku种子图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
运行 heroku运行rake db:seed
我得到
命令:: 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]-resize1x1< /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]'
命令: :convert/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1ng5f6c[0]-resize260x190/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1mz0u16 [ 0]
Command :: file -b --mime'/tmp/image20130219-2-1gk1yip20130219-2-t3caqg.png20130219-2-1mz0u16'
[回形针]保存附件。
我得到了我的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- '
gem'coffee-rails'
gem'rails_autolink'
gem'formtastic'
gem'paperclip'
gem'rmagick','2.12.0'
gem'pg'
gem'uglifier'
解决方案 div>
找到解决方案。
thx 此
和此
和此
与
gem'aws-sdk'
When I run heroku run rake db:seed
I get
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.
I got my Stuff and valid db record, but image is not recreated in public folder.. If I add image through view form all is good.
My seed
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'
解决方案
Found solution.
thx this
and this
and this
with
gem 'aws-sdk'
这篇关于用回形针在heroku种子图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文