title: RUBY CSV Gem generating random quotation mark
body: <p>I'm trying to generate a <code>csv</code> file from a <code>SQL query result</code>.
  99% of the time it does work fine, but in some lines (rows) of the CSV file, it does generate a quotation mark at the start and the end of the row.</p>
  
  <p>The problem pictured:
  <a href="https://i.stack.imgur.com/tHlBK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tHlBK.png" alt="enter image description here"></a></p>
  
  <p>I've already checked the content of the SQL cells and it is ok.</p>
  
  <p>So I think the problem happens when generating the file.</p>
  
  <p>Here it is the way the file it's been generated.</p>
  
  <pre><code>#load query result
  dataset = DB[ "select
                          id
                         ,action
                from
                          some_table"]
  
  #generate csv file
  CSV.open("#{table}.csv", "wb",:write_headers=&gt; true, :headers =&gt; ["id_cliente|""acao"] ) do |csv|
        dataset.each do |dbrow|
          csv &lt;&lt; [
                  "#{dbrow[:id_cliente]}"
                  + "|" +
                  "#{dbrow[:acao]}"
                  ]
          end
  end
  
  new_object = $bucket_response.objects.build("#{table}.csv")
  new_object.content = open("#{table}.csv")
  new_object.acl = :public_read
  new_object.save
  </code></pre>
  
  <p>Is there anyway so solve it or improve the generating process?</p>