title: Ruby: data doesn't have quotation mark but CSV.parse raises CSV::MalformedCSVError: Illegal quoting in line x
body: <p>I'm using ruby CSV.parse to read live data from Google sheet for my Rails project.
  In my seeds.rb file, I'm reading csv data like this</p>
  
  <pre><code>point_csv_path = "https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&amp;sheet=points"
  CSV.parse(open(point_csv_path), :headers=&gt;true).each do |row|
     Point.create!(
        point_id: row["point_id"].to_i, 
        point_type: row["point_type"], 
        identifier: row["identifier"].to_i, 
        longitude: row["longitude"],
        latitude: row["latitude"],
        location: row["location"],
        ordering: row["ordering"].to_i)
  end
  </code></pre>
  
  <p>For the data in google sheet,I manually copy and paste from online source and the data doesn't contain any quotation mark at all. The EXACT first 3 lines of data in the google sheet is the following:</p>
  
  <pre><code>point_id    point_type  identifier  longitude   latitude    location    ordering
  1           sensor      1           -71.050054  42.360152   null        0
  2           sensor      2           -71.049428  42.359373   null        0
  3           sensor      3           -71.049337  42.358969   null        0
  </code></pre>
  
  <p>After I ran <code>$ rails db:seed</code>, I get the following error message</p>
  
  <pre><code>rails aborted!
  CSV::MalformedCSVError: Illegal quoting in line 3.
  /media/anyan/file/rails_project/db/seeds.rb:33:in `&lt;main&gt;'
  /media/anyan/file/rails_project/bin/rails:9:in `&lt;top (required)&gt;'
  /media/anyan/file/rails_project/bin/spring:15:in `&lt;top (required)&gt;'
  bin/rails:3:in `load'
  bin/rails:3:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:seed
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>I know there are a lot of similar questions on stackoverflow but none of them I tried solve my problem. For example, adding <code>:quote_char =&gt; "|"</code> or <code>:encoding =&gt; 'bom|utf-8'</code> as argument for CSV.parse(). I thought it was something related to reading csv data stream so I downloaded the data to disk and I have the same error. How can I solve this problem? Thanks!</p>
  
  <p>UPDATE: after download csv file to local disk and open with VSCode, the first 3 lines of data is:</p>
  
  <pre><code>"point_id","point_type","identifier","longitude","latitude","location","ordering"
  "1","sensor","1","-71.050054","42.360152","null","0"
  "2","sensor","2","-71.049428","42.359373","null","0"
  "3","sensor","3","-71.049337","42.358969","null","0"
  </code></pre>