All, I am attempting to do an IO.read call on a file inside of one of my model objects. I keep getting Errno::ENOENT The path I''m passing to IO.read is relative to RAILS_ROOT. Two questions: 1) This code was previously executing in my controller - it it significant that I moved it into my model? 2) Is there some way to verify which directory is the current directory for the app.? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
Wes Gamble
2006-Apr-12 18:14 UTC
[Rails] Re: IO.read fails on relative path in model object
I just verified that I can run this same call in my controller object without a problem. Wes Gamble wrote:> All, > > I am attempting to do an IO.read call on a file inside of one of my > model objects. > > I keep getting Errno::ENOENT > > The path I''m passing to IO.read is relative to RAILS_ROOT. > > Two questions: > > 1) This code was previously executing in my controller - it it > significant that I moved it into my model? > > 2) Is there some way to verify which directory is the current directory > for the app.? > > Thanks, > Wes-- Posted via http://www.ruby-forum.com/.
Wes Gamble
2006-Apr-12 18:34 UTC
[Rails] Re: IO.read fails on relative path in model object
Sorry guys. Was in the wrong directory. I chdir''ed and never chdir''ed back to where I thought I was. Wes Gamble wrote:> I just verified that I can run this same call in my controller object > without a problem. > > Wes Gamble wrote: >> All, >> >> I am attempting to do an IO.read call on a file inside of one of my >> model objects. >> >> I keep getting Errno::ENOENT >> >> The path I''m passing to IO.read is relative to RAILS_ROOT. >> >> Two questions: >> >> 1) This code was previously executing in my controller - it it >> significant that I moved it into my model? >> >> 2) Is there some way to verify which directory is the current directory >> for the app.? >> >> Thanks, >> Wes-- Posted via http://www.ruby-forum.com/.