I have a very simple ruby script that uses puts to print to the console.
I used to be able to redirect this output using >, e.g.
d:\maven_helper>generate_dependencies.rb > pom.xml
When I run generate_dependencies it still prints the expected output to
the console, but when I redirect it, the file stays empty.
Of course I can print to the file from within ruby, but I was just
wondering why it's not working anymore. Used the search but could not
find anything.
I have a very simple ruby script that uses puts to print to the console.
I used to be able to redirect this output using >, e.g.
d:\maven_helper>generate_dependencies.rb > pom.xml
When I run generate_dependencies it still prints the expected output to
the console, but when I redirect it, the file stays empty.
Redirection is not done by the Ruby interpreter. In Linux, it is a
task of the shell, which collects anything that is written to file
descriptor 1 (STDOUT) by the program. I see from your syntax that you
are under windows; I have no idea about what happens there.
Carlo
···
Subject: Window 7 output redirection
Date: mar 27 ago 13 02:30:00 +0200
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
If that works, it might be that you are not writing to STDOUT. You may
want to post your script... What happens if you try with a script like
STDOUT.puts("Hello there")
?
Carlo
···
Subject: Re: Window 7 output redirection
Date: mar 27 ago 13 02:43:52 +0200
--
* Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
* di parlare tanto di amore e di rettitudine? (Chuang-Tzu)