Raif S. Naffah
11/26/2004 8:22:00 AM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
hello all,
i wrote a collection of Ruby classes to analyse the log entries
generated by a Billion firewall/router. The script, persists the
_attack_ information in an RDBMS through Active Record (version 1.1).
both myself and a colleague, use the same code, on two different
machines + setup. i use it with:
* Fedora Core 2 GNU/Linux distro,
* ruby 1.8.1 (2003-12-25) [i386-linux-gnu]
* PostGreSQL 7.4
he uses it with:
* Debian distro,
* ruby 1.8.2 (2004-11-03) [i386-linux]
* libmysql-ruby1.8 : 2.4.5-6
the classes run fine in my environment, but throw the following
exception in his:
/usr/local/lib/site_ruby/1.8/active_record/base.rb:817:in `method_missing': undefined method `min' for #<Attack:0x4035a2d8> (NoMethodError)
~ from ./analyser.rb:28:in `analyse'
~ from ./analyser.rb:198:in `run'
~ from ./logan.rb:53:in `run'
~ from ./logan.rb:61
the line in question looks like so:
at = Attack.find_by_sql( "SELECT MIN(occured_on) " + "FROM attacks " + "WHERE occured_on BETWEEN '#{start_date_str}' AND '#{end_date_str}'")[0].min
the Attack class is defined as:
class Attacker < ActiveRecord::Base
has_many :attacks
has_many :black_listings
end
trying to find out more how the 'at' object (instance of Attack) looks
like when the exception is thrown, reveals an object with an instance
attribute that looks like so:
@attribute {"MIN(occured_on)"=>"some date..."}
any idea why this is happening? and, most importantly if he is missing
some library, which one is it?
TIA + cheers;
rsn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Que du magnifique
iD8DBQFBpue0+e1AKnsTRiERA7zMAKCggpo00bs6YkkrV6/QmFCod6AGRACg1DQ9
y5Ob5zLbKxwaEuVCFqUocCY=
=hG/K
-----END PGP SIGNATURE-----