Ruby の mail がTLS関連のエラーを吐いたので調べた。
TLS関連のエラー。
/usr/lib/ruby/1.8/net/smtp.rb:577:in `initialize': wrong argument (NilClass)! (Expected kind of OpenSSL::SSL::SSLContext) (TypeError) from /usr/lib/ruby/1.8/net/smtp.rb:577:in `new' from /usr/lib/ruby/1.8/net/smtp.rb:577:in `original_tlsconnect' from /usr/lib/ruby/gems/1.8/gems/mail-2.5.4/lib/mail/core_extensions/smtp.rb:14:in `tlsconnect' from /usr/lib/ruby/1.8/net/smtp.rb:562:in `do_start' from /usr/lib/ruby/1.8/net/smtp.rb:525:in `start' from /usr/lib/ruby/gems/1.8/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!' from /usr/lib/ruby/gems/1.8/gems/mail-2.5.4/lib/mail/message.rb:248:in `deliver!' from mail_test.rb:29
エラーが出た箇所
1 #!/usr/bin/env ruby 2 #coding:utf-8 3 $KCODE = 'u' 4 require 'rubygems' 5 6 gem 'mail', "< 2.5.3" # バージョンが新しいとSSL系のエラーでハマる 7 require 'mail'