FasterCSV permission problem?

B

bechbox

I'm installing FasterCSV (sudo gem install fastercsv) but when I'm
using it with Rails I get and "uninitialized constant FasterCSV" error.

So - in the gem directory when running rake I get a whole bunch of
permission errors like:

1) Error:
test_append(TestFasterCSVInterface):
Errno::EACCES: Permission denied - ./test/temp_test_data.csv
./test/tc_interface.rb:16:in `initialize'
./test/tc_interface.rb:16:in `setup'

but when running sudo rake everything is fine.

Are the two problems (the Rails error and the permission error) related
to each other?

/megl
 
B

bechbox

Yeah - I tried to change the permissions and that allows me to run the
tests, but I can figure out how to get rid of the "uninitialized
constant FasterCSV"

/megl
 
J

James Edward Gray II

I'm installing FasterCSV (sudo gem install fastercsv) but when I'm
using it with Rails I get and "uninitialized constant FasterCSV"
error.

So - in the gem directory when running rake I get a whole bunch of
permission errors like:

1) Error:
test_append(TestFasterCSVInterface):
Errno::EACCES: Permission denied - ./test/temp_test_data.csv
./test/tc_interface.rb:16:in `initialize'
./test/tc_interface.rb:16:in `setup'

but when running sudo rake everything is fine.

Are the two problems (the Rails error and the permission error)
related
to each other?

Nope, I get the same permission errors here, if I try to run Rake in
the gem directory. I use the gem all the time though.

As for the uninitialized constant error, how are you requiring
FasterCSV? You added something like the following to the end of
environment.rb?

require "rubygems" # not sure if thats needed, but it may
# be if you vendor Rails
require "faster_csv"

Just FYI, I use FasterCSV in a lot of Rails projects and I prefer to
vendor it, so I can count on it being there without an install.

James Edward Gray II
 
G

Gregory Brown

I'm installing FasterCSV (sudo gem install fastercsv) but when I'm
using it with Rails I get and "uninitialized constant FasterCSV" error.

So - in the gem directory when running rake I get a whole bunch of
permission errors like:

1) Error:
test_append(TestFasterCSVInterface):
Errno::EACCES: Permission denied - ./test/temp_test_data.csv
./test/tc_interface.rb:16:in `initialize'
./test/tc_interface.rb:16:in `setup'

this is normal. It looks like JEG2 is testing CSV writing, and you're
writing to a root owned directory. This can be avoided if james uses
either MockFS or perhaps tempfile, but it's not necessary. If you
want to run rake against the gem sources, you might just try:

gem unpack fastercsv in your home directory.

I don't think it's a good idea to change the permissions in your
/usr/lib/ruby dir.
 
B

bechbox

James, thanks for your answer. Maybe I should try to reinstall ... and
to vendor it sounds like a good idea.

/megl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,212
Messages
2,571,102
Members
47,697
Latest member
looped_monk

Latest Threads

Top