views:

62

answers:

2

I installed the fastercsv gem like this:

sudo gem install fastercsv

Then in my controller I put this:

require 'fastercsv'

When I try to use it though, I get this error:

MissingSourceFile in Notes#export_data
no such file to load -- fastercsv

What have I done wrong? Thanks for reading.

EDIT: I'm using Rails 2.3.5

rake gems
(in /Users/bh/rails_projects/notes)
 - [I] authlogic 
    - [R] activesupport 
 - [I] searchlogic 
    - [R] activerecord >= 2.0.0

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

-

gem which fastercsv
/usr/local/lib/ruby/gems/1.8/gems/fastercsv-1.5.3/lib/fastercsv.rb
A: 

What version of Rails are you using?

If it's Rails 3 you'll need to specify it as a dependency of your application in the Gemfile:

gem 'fastercsv'
Ryan Bigg
@Ryan Bigg - Sorry, should have mentioned in the question but I'm using Rails 2.3.5
ben
+1  A: 

You should add it to your config/environment.rb

config.gem "fastercsv"

You'll see a few other lines mentioning config.gem, so stick it next to those. You might have to add :version => 'x.x.x', if you have multiple versions of fastercsv and want to use a specific one.

theIV