开发者

How does $DEBUG variable get set when running a Ruby script

开发者 https://www.devze.com 2023-03-13 12:49 出处:网络
I tried running the script test.rb, containing: puts \"Debugging\" if $DEBUG using the command: > ruby test开发者_StackOverflow社区.rb --debug

I tried running the script test.rb, containing:

puts "Debugging" if $DEBUG

using the command:

> ruby test开发者_StackOverflow社区.rb --debug

The --debug switch seems to have no effect. What gives?


Duh... debug parameter needs to be passed to Ruby.

> ruby --debug test.rb

works as expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号