Brett Kruger wrote in post #992039: > line_count = 0 > File.open("text.txt", "r").each { |line| line_count += 1 } > puts line_count > > text.txt is in the same folder as my ruby file very strange... what version of ruby are you running? this code copied and pasted works for me in 1.8.7 and 1.9.2. are you absolutely sure the .txt file is in the same directory as the program, and that it's called "text.txt"? can't think of any other reason it wouldn't work... good luck, -j -- Posted via http://www.ruby-forum.com/.