I'm currently trying to program in ruby using a program called 'freeride'. I'm having real trouble with running this- just clicking on the standard bat to open it it appears for a few brief seconds and then vanishes not giving me time to write anything. Saving a txt file as a .rb then running that runs the code I wrote in the text editor however it then vanishes as soon as its done.
How would I ensure a bat file stays open even when it has finished running?
For a guide to Ruby that may help you click here. It doesn't mean anything to me as I hadn't heard of Ruby before today but there is something about pausing using a method called 'gets' in the middle of chapter 4 under 'The Flipping Script'.
Another method I found involves creating a standard batch file to run the ruby program.
@echo off c:\ruby\bin\ruby %1 pause
You just run the batch file and append the name of your ruby file as in "batchfile.bat whatever.rb" but leave out the quotes. The 'pause' makes the batch file wait until you press a key.
If your using it in Windows, try using the command prompt (start\run\command).
It you run a bat file in windows it opens a command prompt window to run the file and then closes the window when done. Opening the command prompt window first means that when the bat file is finished you still have the prompt and window.
This thread is now locked and can not be replied to.