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.