On 27 May 2012 06:31, Prajwal B. <[email protected]> wrote: > Dir.glob("data-hold/pages/*.html").each do |fname| > meta_info = File.basename(fname, '.html').split('--') > page = Nokogiri::HTML(open(fname)) > > page.css("#{TABLE_DIV_ID} tr")[1..-2].each do |tr| > data_tds = tr.css(td).map{ |td| > td.text.gsub(/[$,](?=\d)/, '').gsub(/\302\240|\s/, '').strip > } > > error in each do method in first line of both blocks
Why have you posted this again rather than continuing with previous thread? As I said previously the object you are calling .each on must be nil. Have a look at the Rails Guide on Debugging for suggestions as to how to debug the code to find out why. Colin > > block irb binding in second block first line > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

