本文介绍了Rails的Heroku的服务器曲别针的Amazon S3 - AWS :: S3 ::错误::将requestTimeout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我救了我的konkurrencer模型与影像附加我得到在Heroku上一个错误,但不是我的本地服务器上。
When I am saving my konkurrencer model with a attached image I get a error on Heroku, but not on my local server.
。我的Heroku的日志:
.My heroku log:
←[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.):
我的模型照片:
My photo model:
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'
}
它工作正常,我的本地服务器上。
It works fine on my local server.
我USNG Heroku的堆栈竹MRI-1.9.2和导轨的verison是3.0.9
I am usng the Heroku stack bamboo-mri-1.9.2 and the verison of rails is 3.0.9
推荐答案
有一个问题与当前版本的回形针3.0.1:
There is a problem with the current version paperclip 3.0.1:
https://github.com/thoughtbot/paperclip/issues/721
和
https://github.com/thoughtbot/paperclip/issues/751
有没有使用回形针的2.7版本解决这个问题。
Did solve this using version 2.7 of paperclip.
这篇关于Rails的Heroku的服务器曲别针的Amazon S3 - AWS :: S3 ::错误::将requestTimeout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!