"no such file to download - faster csv" when trying to use quickcsv gem

I installed the fastcsv gem as follows:

sudo gem install fastercsv

Then in my controller I will put this:

require 'fastercsv'

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

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

How am I wrong? Thanks for reading.

EDIT: I am 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
+3
source share
3 answers

You must add it to your config/environment.rb

config.gem "fastercsv"

You'll see a few other lines that mention it config.gem, so stick with them next to them. You may need to add :version => 'x.x.x'if you have several versions of quickcsv and want to use a specific one.

+3
source

You only need to add the following line to the GemFile

gem 'fastcsv'

.

+2

What version of Rails are you using?

If this is Rails 3, you need to specify it as a dependency of your application on the Gemfile:

gem 'fastercsv'
+1
source

Source: https://habr.com/ru/post/1767715/


All Articles