It sounds like there may be an argument which is being read in by gets() (so it won't stop to read from the prompt - this is an odd curiosity of gets).
When stopped at the breakpoint, hover over the sourcedir variable (or use the Watch window). What is its value?
You may also try repeating the
gets line - i.e.
sourcedir = gets().chomp()
sourcedir = gets().chomp()
If it has read a commandline arg the first time it should stop for more input the second time. If that's the case the next thing to do is work out why you have extra args. You may want to check the Project properties to see if there is anything set there.
Huw