Schedule a Ruby run
This is my first posting and before I state my problem I would like to express my appreciation to those that provided WATIR and RUBY, they are wonderful products.
I am using a scheduled BAT file to run multipul Ruby scripts on a WIN 2003 server. I am appending the script outputs to a file. As long as I am logged on all is well. When I log off the first append works fine but Ruby stays loaded and locks the file. Subseqent scripts die on the locked file. How can I tell Ruby to quit?
Process.exit or Process.exit! maybe?
that's weird that the ruby interpreter would hang around, however it shouldn't matter if you close the file every time you're done writing to it. Also you might try to ensure that the scripts aren't getting executed concurrently, so in your bat file don't use something like the start command. If you have to use the start command, then have the start command execute a single ruby script that calls the other's in sequence and then kills itself.
Not sure if any of this information is relevant or even accurate, but I hope it helps.
I'm not sure if this is pertinent or not but are you using the block form to open and write then close your file? If not that may be the problem. Here is an example of the block form of file IO:
File.open("myfile.txt","w+") do |file|
If you do it this way the file will always get closed for you and ruby should not hold a lock on the file.