title: Rails- upgrading to ruby 2.2.2 - no implicit conversion of Array into String (TypeError)
body: <p>very new to ruby and rails.. Ive been working on a project, that simply reads in files and parses them to store into a database. Project was running fine, however running the code after an update to ruby 2.2.2 , I received an error that wasn't previously there:</p>
  
  <pre class="lang-none prettyprint-override"><code>in `foreach': no implicit conversion of Array into String (TypeError)
  </code></pre>
  
  <p>Here is the snippet of the <code>foreach</code> thats causing an error: (let me know if more code is necessary). </p>
  
  <pre><code>def parse(file_name)
    File.foreach(file_name).with_index do |line, line_num|
      puts "\nLine #{line_num}: #{line}"
  </code></pre>
  
  <p>Does anyone know whats going on?
  Thank you</p>
  
  <p>EDIT: Sorry it was a snippet! Im calling this ruby code into my rails Test called "parse_log_file_test"</p>
  
  <pre><code>require File.dirname(__FILE__) + '/../test_helper'
  
  class ParseLogFileTest &lt; ActiveSupport::TestCase
  
    filename = Array.new
  
    Dir.glob('database/oag-logs/*.log').each do |log_file|
  
      filename.push(log_file)
  
    end
  
    parser = ParseLogFile.new
  
    parser.parse(filename)
  
    test 'parse' do
      parser = ParseLogFile.new
  
      filename.each do |log_file|
  
        begin
  
          parser.parse(log_file)
        rescue
  
          puts"ERROR: Unable to parse line #{log_file}"
  
        end
      end
      assert true
    end
  end
  </code></pre>