From: Jam Date: 2012-08-29T12:58:09+09:00 Subject: Re: What Really is Happening? On Aug 28, 2012, at 9:46 PM, Pepe Pew wrote: > Hello, I need your help. > I just made the file "analyzer.rb" and placed on a folder. > This file has the code: > > line_count = 0 > File.open("text.txt").each { |line| line_count += 1 } > puts line_count > > I tried to run it by CMD, but it doesn't oppened the "text.txt" file. > "analyzer.rb" and "text.txt" are on the same folder. it looks like you're executing the script from a different directory than it exists in. Try cd-ing into the script's directory before executing it, or put an absolute path to text.txt into your script. Look up how the current working directory of a process is set.