→ Problem with MySQL and NULL pointer with ActiveRecord → → →

Today I encountered problem on one of new servers we got, right after migrating application to it. Accessing data using ActiveRecord was failing even with simples statement Model.all. Error was:

ArgumentError (NULL pointer given):
     (eval):3:in `each_hash'
     (eval):3:in `all_hashes'

Solution turned out to be removing mysql client from the machine, reinstalling it as the first step, and then as a second step removing and reinstalling mysql gem. Things just started working afterwards. Piece of cake for sysadmins.

Created on 07 July 2009