From: Adrian Tepes Date: 2010-10-30T05:46:26+09:00 Subject: Re: undefined method `each' Russ Forsythe wrote in post #958057: > Before I explain the issue I’m having I should preface it with some > important information. I’m a novice programmer at best and I’m new to > Ruby… > > I’m trying to capture the authentication token from Nessus so I can use > it to run scans, reports, etc. I found the following code on the Nessus > site but I’m getting “undefined method `each' for > # (NoMethodError)” from a line of code near the > bottom (response.body.each do |line|). I’m using Ruby 1.9.1 running on > Linux (Ubuntu 10.04). Any insight you can provide would be much > appreciated! Hi It seem that the method "each" in String has been removed from version 1.9.*,you can see the build-in method declaration in string.c: rb_define_method(rb_cString, "each_line", rb_str_each_line, -1); rb_define_method(rb_cString, "each_byte", rb_str_each_byte, 0); rb_define_method(rb_cString, "each_char", rb_str_each_char, 0); rb_define_method(rb_cString, "each_codepoint", rb_str_each_codepoint, 0); There is no "each",use "each_line" or others instead. -- Posted via http://www.ruby-forum.com/.