N
Nick Shaw
Hi, Ive just started learning Ruby and I'm having a problem with the
following program. I'm running it on Ubuntu.
lines = File.readlines("/home/nick/ruby/analyzer/oliver.txt")
line_count = lines.size
text = lines.join
puts "#{line_count} lines"
total_characters = text.length
puts "#{total_characters} characters"
I keep getting a "No such file or directory error" and I can't
understand why. The file definitely exists at that location. It's really
annoying me.
following program. I'm running it on Ubuntu.
lines = File.readlines("/home/nick/ruby/analyzer/oliver.txt")
line_count = lines.size
text = lines.join
puts "#{line_count} lines"
total_characters = text.length
puts "#{total_characters} characters"
I keep getting a "No such file or directory error" and I can't
understand why. The file definitely exists at that location. It's really
annoying me.