title: Ruby : NoMethodError: undefined method `split' on text file
body: <p>I'am trying to load a txt file (line by line) into an array but I'm getting hit with NoMethodError error.</p>
  
  <pre><code>input_log = File.open("C:/text_file.txt", "r")
  array1 = input_log.split("\n")
  array1.each do |element|
    puts element
  end
  </code></pre>
  
  <p>When you run this, I get </p>
  
  <pre><code>**:in `&lt;top (required)&gt;': undefined method `split' for #&lt;File:C:/text_file.txt&gt; (NoMethodError)
      from -e:1:in `load'
      from -e:1:in `&lt;main&gt;'**
  </code></pre>
  
  <p>PS: Ruby Beginner - Pls help</p>