FasterCSV permission problem?

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

bechbox@gmail.com wrote:

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?

Have you considered changing the permissions to eliminate the error? When
you find yourself in a situation where everything is fine while borrowing
root permissions, but things fall apart otherwise, the solution seems
obvious.

···

--
Paul Lutus
http://www.arachnoid.com

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

···

On Sep 18, 2006, at 5:01 AM, bechbox@gmail.com wrote:

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?

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.

···

On 9/18/06, bechbox@gmail.com <bechbox@gmail.com> wrote:

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'

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

Paul Lutus wrote:

···

bechbox@gmail.com wrote:

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

Have you considered changing the permissions to eliminate the error? When
you find yourself in a situation where everything is fine while borrowing
root permissions, but things fall apart otherwise, the solution seems
obvious.

--
Paul Lutus
http://www.arachnoid.com

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

/megl

James Edward Gray II wrote:

···

On Sep 18, 2006, at 5:01 AM, bechbox@gmail.com wrote:

> 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