Saturday, May 26, 2012

[Rails] no method "each" method for nilclass

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

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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate