From: Chris Hulan Date: 2012-11-16T03:55:02+09:00 Subject: Re: following along with "Beginning Ruby." --f46d043c8222c0da3704ce8d28ef Content-Type: text/plain; charset=ISO-8859-1 try the second with '/' instead of '\' path separator On Thu, Nov 15, 2012 at 1:20 PM, Al Baker 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 `
' > > 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 `
' > help! > > -- > Posted via http://www.ruby-forum.com/. > > --f46d043c8222c0da3704ce8d28ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable try the second with '/' instead of '\' path separator


On Thu, Nov 15, 201= 2 at 1:20 PM, Al Baker <lists@ruby-forum.com> 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 a= bout
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
=A0 =A0 =A0 =A0 from (irb):1:in `initialize'
=A0 =A0 =A0 =A0 from (irb):1:in `open'
=A0 =A0 =A0 =A0 from (irb):1
=A0 =A0 =A0 =A0 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
=A0 =A0 =A0 =A0 from (irb):4:in `initialize'
=A0 =A0 =A0 =A0 from (irb):4:in `open'
=A0 =A0 =A0 =A0 from (irb):4
=A0 =A0 =A0 =A0 from C:/Ruby193/bin/irb:12:in `<main>'
=A0help!

--
Posted via http://= www.ruby-forum.com/.


--f46d043c8222c0da3704ce8d28ef--