From: dusty Date: 2007-10-27T06:20:02+09:00 Subject: Re: Ruby Radius Dictionary On Oct 26, 12:25 am, Aby azid Abu bakar wrote: > Hie, > > Im trying to communicate with radius server using example file from > ruby-radius-0.9.9 and encountered with this error > > "/usr/lib/ruby/site_ruby/1.8/radius/dictionary.rb:294:in > `vsattr_numtype': undefined method `[]' for nil:NilClass (NoMethodError) > from /usr/lib/ruby/site_ruby/1.8/radius/packet.rb:145:in > `unpack' > from radiusclient.rb:50" > > Can anyone help. > > Thanks, > Aby Azid > -- > Posted viahttp://www.ruby-forum.com/. I'm using that library, I just ran a test and that file worked fine for me. I am using the auth.rb file to simply check for authorization. It works well for me. First, I had to change this line in auth.rb attr_reader :@packet to attr_reader :packet Here is the class I made for checking authentication. class RadiusUtils def initialize(hostname,secret) @hostname, @secret = hostname, secret @dictionary = "/some/path/to/dictionary" end def authenticate(username,password,nasip=nil,timeout=nil) nasip = nasip || "127.0.0.1" timeout = timeout || 5 rad = Radius::Auth.new(@dictionary,@hostname,nasip,timeout) rad.check_passwd(username,password,@secret) end end radius = RadiusUtils.new("x.x.x.x","secret") radius.authenticate("username","password") If you are only trying to authenticate to radius, perhaps that will work for you.