try the second with '/' instead of '\' path separator
On Thu, Nov 15, 2012 at 1:20 PM, Al Baker <[email protected]> wrote: > I'm having trouble following along with some of the examples in this > "Beginning Ruby(2nd Edition). I'm at the section where you learn about > I/O handling and tried to do one of the examples and got an error. Not > sure what I did wrong: > > irb(main):001:0> File.open("olivertext.txt") do |f| > irb(main):002:1* puts f.gets > irb(main):003:1> end > Errno::ENOENT: No such file or directory - olivertext.txt > from (irb):1:in `initialize' > from (irb):1:in `open' > from (irb):1 > from C:/Ruby193/bin/irb:12:in `<main>' > > I tried to use the whole directory to find the file, and got this: > > <"C:\Users\Al Baker\Documents\Programming\RuBy olivertext.txt") do |f| > irb(main):005:1* puts f.gets > irb(main):006:1> end > Errno::ENOENT: No such file or directory - > C:UsersAlBakerDocumentsProgrammingRuBy olivertext.txt > from (irb):4:in `initialize' > from (irb):4:in `open' > from (irb):4 > from C:/Ruby193/bin/irb:12:in `<main>' > help! > > -- > Posted via http://www.ruby-forum.com/. > > -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
