我已经在轨道中实现了回形针,正如各种教程所推荐的那样.在尝试上传照片时,我始终如一地获得以下内容:
AWS::S3::NoConnectionEstablished
usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb:213:in `connection'
/usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:69:in `request'
/usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/base.rb:88:in `put'
/usr/local/lib/ruby/gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:241:in `store'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip/storage.rb:195:in `flush_writes'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip/storage.rb:192:in `each'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip/storage.rb:192:in `flush_writes'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip/attachment.rb:142:in `save'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:331:in `send'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:331:in `save_attached_files'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:324:in `each_attachment'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:323:in `each'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:323:in `each_attachment'
/Users/joshcutler/code/NiteMob/vendor/plugins/paperclip/lib/paperclip.rb:330:in `save_attached_files'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `send'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:166:in `call'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:93:in `run'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `each'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `send'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:92:in `run'
/Users/joshcutler/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/callbacks.rb:276:in `run_callbacks'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:344:in `callback'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:251:in `create_or_update'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2539:in `save_without_validation'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:1009:in `save_without_dirty'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/dirty.rb:79:in `save_without_transactions'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `send'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:182:in `transaction'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/transactions.rb:196:in `save'
/Users/joshcutler/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2628:in `update_attributes'
Run Code Online (Sandbox Code Playgroud)
这是我的模型声明:
attr_accessor :image_file_name
has_attached_file :image,
:styles …Run Code Online (Sandbox Code Playgroud) Rails 3 app with paperclip.
给定Paperclip文件模型,如何将该回形针文件移动到不同的回形针,比如图库?哪个会有不同的处理规则等?
有任何想法吗?
我正在寻找使用rails_admin进行多文件上传的快速解决方案.
有什么想法或解决方案吗?
paperclip carrierwave rails-admin ruby-on-rails-3.1 dragonfly-gem
我在S3上使用paperclip生成过期的签名URI.但是,在每个请求中,我生成一个不理想的新URI,它会强制浏览器在每次刷新页面时从S3下载一组新图像.
我想要做的是将生成的URI缓存的时间少于它们在S3上过期的时间.有没有人之前做过这样的事情,可以建议一个解决方案.
如果这表明解决方案(或不是),我正在heroku上部署
我正在使用CKEditor并且我已将其配置为与Paperclip一起使用但我不能告诉它在S3中存储文件,因此它使用Paperclip存储它们但在本地文件系统上.
所以我想知道是否有某种方法告诉Paperclip每次使用时都明确使用S3.
我知道如何在某些模型上配置带有S3的Paperclip(非常简单,在paperclip github wiki上有描述).我正在Heroku上部署,这就是我无法写入本地文件系统的原因.
出于某种原因,每当我将所有图像从所有用户中删除时,Capistrano都会删除我数据库中的所有图像.通常,我所做的是必须使用capistrano删除的相同图像重新填充数据库.我已经附上了我的deploy.rb文件,有人可以给我一些见解.
require "bundler/capistrano"
set :rvm_ruby_string, '1.9.3p429'
set :rvm_type, :user
set :user, ""
set :password, ""
set :domain, ""
set :applicationdir, ""
set :scm, :git
set :repository, ""
set :git_enable_submodules, 1 # if you have vendored rails
set :branch, "release"
set :rails_env, 'production'
#set :git_shallow_clone, 1
set :scm_verbose, true
# roles (servers)
role :web, domain
role :app, domain
role :db, domain, :primary => true
set :port, 22
# deploy config
set :deploy_to, applicationdir
set :deploy_via, :remote_cache
# additional settings
default_run_options[:pty] = …Run Code Online (Sandbox Code Playgroud) 我正在使用带有 Rails4 的 Paperclip。我有以下图片

现在我想调整大小和裁剪图像,但它被裁剪并且图像的方向被移位,如下所示

:photo,
:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
:url => "/system/:attachment/:id/:style/:filename",
:styles => {
:small => { :geometry => "100x100!" },
:medium => { :geometry => "500x500!"}
}
Run Code Online (Sandbox Code Playgroud) 我使用rails 4 nested_form为我的模型创建一个表单.模型相册有很多图像.上传图片的部分表格如下:
<div class="field">
<%= f.fields_for :images do |image_form| %>
<div>
<%= image_form.file_field(:image_file) %>
<%= image_form.link_to_remove "Remove this image" %>
</div>
<% end %>
</div>
Run Code Online (Sandbox Code Playgroud)
如何在编辑表单上为每个图像显示一个拇指?目前只有编辑时出现浏览按钮.
无论如何在Ruby on Rails中转换图像URL(https://meo-fb-natal-dev.s3.amazonaws.com/participations/cropped/56658c5de2fc7116340000c0/635769180217506883-GD5A9264.jpg?1449495643)中托管的图像Base64编码?
我已经尝试了很多东西,但它们似乎都没有用.
我想创建一个小票系统:http ://ticketsystemkm.herokuapp.com/
我有电影海报在主站点上显示它们.
当我制作新电影时,一切都很好,但几个小时后图像消失了.也许有人有类似的问题,知道如何解决它.
paperclip ×10
amazon-s3 ×3
heroku ×2
capistrano ×1
carrierwave ×1
ckeditor ×1
nested-forms ×1
rails-admin ×1
ruby ×1