Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 ruby-debug 来调试我编写的这个脚本,它一直在线终止,if __FILE__ == $0. 我遍历它之前的每一行,然后当它到达那一行时它就退出了。没有错误或任何东西,它只是退出。我该如何解决?
if __FILE__ == $0
实际上,一切都按预期进行。该if __FILE__ == $0成语基本上翻译为“如果此文件是正在运行的程序”,如果从调试器运行则不是。有关此问题的讨论,请参见以下关于 ruby-talk 的线程:
http://www.ruby-forum.com/topic/113859#new