views:

283

answers:

2

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..

+1  A: 

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

davydotcom
I got this error application.rb:54:in `require': no such file to load -- fastercsv (LoadError)
lakshmanan
actually i have a set of require statements in the application.rb for gems that are used in the app one of which is require 'fastercsv' in 54th line.
lakshmanan
You should not be putting requires for gems in your application.rb like that. Use bundler to configure all the required gems for your project as this is the new defacto method of including gems in a project.
davydotcom
Also it looks like fastercsv is the standard now with ruby 1.9 and you may not even need to require fastercsv or even include it as a gem.
davydotcom
if i put a gem "gemname", will that be automatically required ???
lakshmanan
inside of bundler? Yes. The Bundler.require function is actually designed to iterate through the list of gems in the Gemfile and require them into your project.
davydotcom
A: 

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'

rogerdpack