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.
Hello Jam, Andriy A. and Robert K., thank you for this help.
The file was really on same fold.
The only thing I did it was change the file “text.txt” for “file.txt” of
the file name and on the ruby cody, then it worked
I don’t understood why “text.txt” was not working, but what matters is
that now it worked.
Thank you a lot!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.