Rails Heroku服务器使用paperclip上传文件到Amazon S3时出现AWS::S3::Errors::RequestTimeout错误。

9
当我在保存附带图片的 konkurrencer 模型时,我在 Heroku 上会遇到错误,但在我的本地服务器上不会。
我的 Heroku 日志:
[36m2012-04-01T17:45:37+00:00 app[web.1]:←[0m Started POST "/admin/konkurrencer
s" for MYIP at 2012-04-01 10:45:37 -0700
←[33m2012-04-01T17:46:01+00:00 heroku[router]:←[0m POST www.konkurrencerher.dk/a
dmin/konkurrencers dyno=web.1 queue=0 wait=0ms service=24565ms status=500 bytes=
728
←[32m2012-04-01T17:46:01+00:00 heroku[nginx]:←[0m MYIP - - [01/Apr/201
2:17:46:01 +0000] "POST /admin/konkurrencers HTTP/1.1" 500 728 "http://www.konku
rrencerher.dk/admin/konkurrencers/new" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:1
1.0) Gecko/20100101 Firefox/11.0" www.konkurrencerher.dk
←[36m2012-04-01T17:46:01+00:00 app[web.1]:←[0m
←[36m2012-04-01T17:46:01+00:00 app[web.1]:←[0m AWS::S3::Errors::RequestTimeout (
Your socket connection to the server was not read from or written to within the
timeout period. Idle connections will be closed.):

我的照片模型:

class Photo < ActiveRecord::Base
  belongs_to :konkurrencer
  attr_accessor :image_url, :billed_navn
 # Paperclip.options[:command_path] = "/usr/local/bin"
  has_attached_file :image,
          :storage => :s3,
          :bucket => 'konkurrencerher',
          :styles => { :original => ["300x250>", :png], :small => ["165x138>", :png], :mini => ["120x120>", :png] },
          :path => 'images/vind/:style/:id/:basename.:extension',
          :url  => ":s3_path_url",
          :s3_credentials => {
          :access_key_id => 'x',
          :secret_access_key => 'x'
  }

在我的本地服务器上运行良好。

我正在使用Heroku的bamboo-mri-1.9.2堆栈,Rails版本为3.0.9。

1个回答

7

1
这个错误不应该出现在新版本的paperclip 3.0.2中 :) - Rails beginner

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接