Since ssl_requirement overrides the default url_for, it affects ActionMailer too. @request isn't defined in ActionMailer, so line 39 of url_for.rb throws an error. I changed it to the following:
if !(/^https/ =~ (options[:protocol] || (@request.nil? ? '' : @request.protocol) ))