我在Ruby中使用Mandrill-api以编程方式发送交易电子邮件.
我在rails应用程序中有(或多或少)以下行,
mandrill ||= Mandrill::API.new const(:API)[:MANDRILL_APIKEY]
... (constructing the message, content, etc)
mandrill.messages.send_template templ, template_content, message, true
Run Code Online (Sandbox Code Playgroud)
问题是在生产中运行时,偶尔会返回以下错误.
Excon::Errors::SocketError (EOFError (EOFError)):
app/mailers/mailer.rb:24:in `send'
....
Run Code Online (Sandbox Code Playgroud)
我不知道如何调试此问题.如果有人能让我了解调试方法,我非常感谢.
宝石信息:
生产环境:
 sudo bundle exec rake RAILS_ENV=production about
About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.11
Rack version              1.4
Rails version             3.2.13
Active Record version     3.2.13
Action Pack version       3.2.13
Active Resource version   3.2.13
Action Mailer version     3.2.13
Active Support version    3.2.13
Middleware                Rack::Cache, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x00000001e72330>, Rack::Runtime, Rack::MethodOverride, …Run Code Online (Sandbox Code Playgroud) 我得到了这个错误每次由于请求时间和当前时间之间的差异太大.我发现我们需要应用sync_clock选项但不能配置place.see我的配置请帮助我们配置同步时钟
错误:
  Expected(200) <=> Actual(403 Forbidden)
  request => {:headers=>{"Content-Length"=>54911, "Content-Type"=>"image/jpeg", "x-amz-acl"=>"public-read", "Cache-Control"=>"max-age=315576000", "Date"=>"Thu, 24 Oct 2013 01:14:14 +0000", "Authorization"=>"changed", "Host"=>"changed"}, :host=>"changed", :mock=>nil, :path=>"/uploads%2Fproject%2Fimage_1%2F697%2FHamburg-Speicher-im-Bau-090825.jpg", :port=>"443", :query=>nil, :scheme=>"https", :body=>#<File:/app/tmp/carrierwave/20131024-0114-2-7499/Hamburg-Speicher-im-Bau-090825.jpg>, :expects=>200, :idempotent=>true, :method=>"PUT"}
  response => #<Excon::Response:0x0000000b72f0a0 @body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request time and the current time is too large.</Message><MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>EA8E8FF76B54D7F3</RequestId><HostId>/RiS+pn3JcKzOoArMhFRYmSBRYwRAptugp8W32XAT4vupukmxMCtHRKIHy7wy9BL</HostId><RequestTime>Thu, 24 Oct 2013 01:14:14 +0000</RequestTime><ServerTime>2013-10-24T01:29:49Z</ServerTime></Error>", @headers={"x-amz-request-id"=>"EA8E8FF76B54D7F3", "x-amz-id-2"=>"/RiS+pn3JcKzOoArMhFRYmSBRYwRAptugp8W32XAT4vupukmxMCtHRKIHy7wy9BL", "Content-Type"=>"application/xml", "Transfer-Encoding"=>"chunked", "Date"=>"Thu, 24 Oct 2013 01:29:47 GMT", "Connection"=>"close", "Server"=>"AmazonS3"}, @status=403>
  vendor/bundle/ruby/1.9.1/gems/excon-0.6.6/lib/excon/connection.rb:190:in `request' 
Run Code Online (Sandbox Code Playgroud)
初始化
  CarrierWave.configure do |config|
  if Rails.env.production?
    config.fog_directory  = 'ese-prod'
    config.fog_host       = 'https://s3.amazonaws.com/ese-prod' …Run Code Online (Sandbox Code Playgroud)