Archives: 2009 April
FIX: TypeError: wrong argument type nil (expected Module)
April 29th, 2009, Comments Off
If you were using an old ARMailer gem, then removed it and installed another, more frequently updated version, (eg, “adzap-ar_mailer” from Github), you might receive the following error when attempting to send mail:
TypeError: wrong argument type nil (expected Module)
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:109:in `extend’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:109:in `initialize_template_class’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/object/misc.rb:39:in `returning’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/helpers.rb:108:in `initialize_template_class’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:564:in `render’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:552:in `render_message’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:493:in `create!’
from /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:452:in `initialize’
from [...]
Git Submodules and Capistrano
April 22nd, 2009, Comments Off
Small point of reference, if you use git submodules in your rails application, then remember to add:
set :git_enable_submodules, true
to your deploy recipe. This is not very well documented as a lot of documentation on the web for capistrano was written before this feature was included, and before git was widely used.
Where are your users from? – (By SQL Email Domain)
April 19th, 2009, 1 Comment
Ever wondered who your users use as their email provider? Who are the biggest email providers of the users on your website? Luckily SQL has the answer in 1 easy step using the SUBSTRING_INDEX string function.
mysql> SELECT COUNT(*) AS Total, SUBSTRING_INDEX(email, ‘@’, -1) AS Domain FROM users GROUP BY SUBSTRING_INDEX(email, ‘@’, -1) ORDER BY COUNT(*) [...]