# FasterCSV permission problem?

**URL:** <https://www.ruby-forum.com/t/fastercsv-permission-problem/69047>\
**Category:** Ruby\
**Created:** [September 18, 2006, 12:01pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047 "2006-09-18T12:01:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 12:01pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/1 "2006-09-18T12:01:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 12:15pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/2 "2006-09-18T12:15:25Z")

</div>

removed\_email\_address@domain.invalid wrote:

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 1:11pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/3 "2006-09-18T13:11:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/4 "2006-09-18T21:40:59Z")

</div>

On 9/18/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

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

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 11:41pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/5 "2006-09-18T23:41:13Z")

</div>

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

/megl

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 18, 2006, 3:07pm UTC](https://www.ruby-forum.com/t/fastercsv-permission-problem/69047/6 "2006-09-18T15:07:46Z")

</div>

On Sep 18, 2006, at 5:01 AM, removed\_email\_address@domain.invalid wrote:

> ```
> ./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 G. II
