N
Nebs Petrovic
I have no idea what's going on. I've read about a dozen forums about
creating a file but I still can't seem to do it.
I'm running in Windows Vista.
In a folder called "RUBY" I have a ruby file called "filetest.rb".
There are no restrictions on the "RUBY" directory.
In the ruby file there are only 3 lines:
myfile = File.new("somefile.txt", "r+")
myfile.puts "Hello"
myfile.close
When I run "ruby filetest.rb" I get the following error:
filetest.rb:5:in `initialize': No such file or directory - somefile.txt
(Errno::
ENOENT)
from filetest.rb:5:in `new'
from filetest.rb:5
I know there is "no such file", that's why I'm creating it. *scratches
head*. If I create the file manually then it works, but I can't get it
to create the file from scratch. I passed no folder structure in the
arguments so I assume that it should try and create the file in the same
directory of the *.rb file. What am I missing?
Thanks.
creating a file but I still can't seem to do it.
I'm running in Windows Vista.
In a folder called "RUBY" I have a ruby file called "filetest.rb".
There are no restrictions on the "RUBY" directory.
In the ruby file there are only 3 lines:
myfile = File.new("somefile.txt", "r+")
myfile.puts "Hello"
myfile.close
When I run "ruby filetest.rb" I get the following error:
filetest.rb:5:in `initialize': No such file or directory - somefile.txt
(Errno::
ENOENT)
from filetest.rb:5:in `new'
from filetest.rb:5
I know there is "no such file", that's why I'm creating it. *scratches
head*. If I create the file manually then it works, but I can't get it
to create the file from scratch. I passed no folder structure in the
arguments so I assume that it should try and create the file in the same
directory of the *.rb file. What am I missing?
Thanks.