Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 Server Startup problem with fastercsv

I have a rails 2.3.5 app getting upgraded to Rails 3. I did every thing I am required to do for upgrading and when I start the rails server using

rails server

it gives me this

Please switch to Ruby 1.9's standard CSV library.  It's FasterCSV plus
support for Ruby 1.9's m17n encoding engine.

I am using ruby-1.9.2-p0 and have fastercsv (1.5.3) gem installed. with the help of puts statements, i was able to track down where the error occurred. i found that the execution stops at this line

Bundler.require(:default, Rails.env) if defined?(Bundler)

in application.rb file. I tried many things but none worked .. please help..

like image 245
Anand Avatar asked Sep 14 '10 19:09

Anand


2 Answers

Remove fasterCSV from your Gemfile in the application. Bundler is trying to require FasterCSV because you have it specified in the Gemfile.

like image 149
davydotcom Avatar answered Oct 03 '22 00:10

davydotcom


with 1.9 you no longer need/can use the fastercsv gem, since it's bundled in the std lib. Now you just need to do:

require 'csv'
CSV.open("temp.csv", "w") do |csv|
  csv << ["line1row1", "line1row2"]
  csv << ["line2row1", "line2row2"]
  # ...
end
like image 41
rogerdpack Avatar answered Oct 03 '22 02:10

rogerdpack