The second parameter "r" defines that you're opening the file for reading.
File.new("text.txt", "r").each { |line| puts line }