【发布时间】:2013-07-20 05:49:39
【问题描述】:
我在 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
问题是在生产中运行时,它返回以下错误偶尔。
Excon::Errors::SocketError (EOFError (EOFError)):
app/mailers/mailer.rb:24:in `send'
....
我不知道如何调试这个问题。如果有人可以让我了解调试此方法的方法,我将不胜感激。
宝石信息:
- mandrill-api (1.0.33)
- excon (0.16.10)
生产环境:
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, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Environment production
Database adapter mysql2
运行时间:
Apache 服务器:Apache/2.2.22 (Ubuntu)
乘客:3.0.14
【问题讨论】:
-
如果您能提供一些有关您的生产环境的信息,帮助会容易得多。
-
泰勒,添加了生产环境。让我知道是否有其他特定信息可以帮助调试。谢谢。
标签: ruby ruby-on-rails-3 mandrill excon