Thanks for taking time.
--
Posted via http://www.ruby-forum.com/.
$ ruby blah.rb > foo.log 2> &1
Assuming if you are on Unix. People often, use logger library for logging
their Ruby application.If you are on Windowz, then there is one more way,
"rubyw", which will not keep the ruby interpretor running in foreground.
Hi,
On *nix platforms, redirecting output to another file is as simple as
ruby my.rb > output.txt, I believe the same syntax works for windows.
To run the code without using ruby my.rb, you must include a shebang
line
eg
#!/path/to/ruby.exe
at the start of your program file, again on a linux/osx/bsd platform
this would probably be
#!/usr/bin/ruby
Kev
--
"I call it the State where everyone, good or bad, is a poison-
drinker: the State where universal slow suicide is called - life" -
Friedrich Nietzsche
Vijay
Kev Jackson wrote:
>> same window. Now my question is : Can I have my output in some kind of
>> output file instead of command window? Can I have log file, which can
>> show some other display kind of messages only? 3) Is there any other w
>
> Hi,
>
> On *nix platforms, redirecting output to another file is as simple as
> ruby my.rb > output.txt, I believe the same syntax works for windows.
>
> To run the code without using ruby my.rb, you must include a shebang
> line
> eg
> #!/path/to/ruby.exe
>
> at the start of your program file, again on a linux/osx/bsd platform
> this would probably be
>
> #!/usr/bin/ruby
>
> Kev
--
Posted via http://www.ruby-forum.com/.
Recently (=w2k+),
ruby blah.rb > foo.log 2> &1
works on windows as well. Finally ;-)
(That will write all your output into file foo.log)
> Hi,
>
> On *nix platforms, redirecting output to another file is as simple as
> ruby my.rb > output.txt, I believe the same syntax works for windows.
>
> To run the code without using ruby my.rb, you must include a shebang
On windows, the shebang line doesn't work. You have to define
assocation with *.rb and ruby.exe, and have .rb in %PATHEXT%.
One-click installer does it for you. So it's enough to type blah.rb
J.