Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails3+CSV wrong number of arguments (0 for 1) , in generate

In development mode iam using (rails3 and ruby 1.9.2p136) and CSV is working good,

but,

In production mode iam using (rails3 and ruby 1.9.2p0) and CSV throws error

(wrong number of arguments (0 for 1) , in generate)

please can u suggest me what could be the problem.

thanks

like image 349
lamrin Avatar asked Dec 28 '25 22:12

lamrin


1 Answers

I encountered exact same problem on Fedora15 with ruby 1.8.7 . Code below fixed the CSV.generate problem.

if RUBY_VERSION < "1.9" 
require "rubygems" 
require "faster_csv" 
CSV = FCSV 
else 
require "csv"
end
like image 109
dklt Avatar answered Dec 30 '25 16:12

dklt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!