β

CSV reader syntax change in Ruby 1.8.7 and Ruby 1.

RoR Guide & Solutions 207 阅读
The way CSV file is opened in Ruby 1.8.7 and in Ruby 1.9.2 are different, here are the syntax:


@parsed_file = CSV::Reader.parse(File.open(restaurant_file, "rb"))
when running from ruby 1.8.7

new
@parsed_file = CSV.read(restaurant_file)
when running from ruby 1.9.2
作者:RoR Guide & Solutions
Ruby on Rails Guide & Solutions is day to day troubleshooting, issues faced, new findings, conce
原文地址:CSV reader syntax change in Ruby 1.8.7 and Ruby 1., 感谢原作者分享。