Kasey Mccurdy
2008-Jan-28 19:47 UTC
Can write file via IRB, but not from actual controller...odd
i have my rails app hosted at eapps.com (great folks) -- but im running into an ODD issue...maybe someone can help. if i go into IRB and type: File.new("temp.txt", "w") , everything goes well, and it creates the file in the same directory that im in (in the controllers directory...bad, i know...but it works for now)... now, in my controller, i have the exact same thing....but it wont create the file. no errors or anything...it just DOESNT create it... ive chmod''d the directory to 777, but still to no avail...anyone got any ideas? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
kopf1988
2008-Jan-29 16:47 UTC
Re: Can write file via IRB, but not from actual controller...odd
Why are we creating a file anyway? Shouldn''t your data be stored in the database. Although I know I would need to create files for things like profile avatars, but I don''t know about this. Don''t forget to do file.close() or something similar, perhaps it''s not actually getting written until you do that? Also, maybe it''s being created in the / public/ directory, because that''s where the dispatch.cgi is running your program. -Ryan On Jan 28, 1:47 pm, Kasey Mccurdy <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> i have my rails app hosted at eapps.com (great folks) -- but im running > into an ODD issue...maybe someone can help. > > if i go into IRB and type: > > File.new("temp.txt", "w") > > , everything goes well, and it creates the file in the same directory > that im in (in the controllers directory...bad, i know...but it works > for now)... > > now, in my controller, i have the exact same thing....but it wont create > the file. no errors or anything...it just DOESNT create it... > > ive chmod''d the directory to 777, but still to no avail...anyone got any > ideas? > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---