From: Dave Thomas Date: 2010-09-17T07:39:49+09:00 Subject: [ruby-core:32448] [Ruby 1.9-Bug#3843][Open] ruby -r tracer prog.rb no longer tracers prog.rb Bug #3843: ruby -r tracer prog.rb no longer tracers prog.rb http://redmine.ruby-lang.org/issues/show/3843 Author: Dave Thomas Status: Open, Priority: Normal Category: lib ruby -v: 1.9.2 The problem appears to be at the end of tracer.rb: if $0 == __FILE__ # direct call $0 = ARGV[0] ARGV.shift Tracer.on require $0 elsif caller.size <= 1 Tracer.on end IN 1.9.2, caller() at this point is 2 deep: [":29:in `require'", ":29:in `require'"] The following change seems to fix it, but it feels a little hacky.. if $0 == __FILE__ # direct call $0 = ARGV[0] ARGV.shift Tracer.on require $0 elsif caller.size <= 2 && caller.all? {|place| place =~ /custom_require/} Tracer.on end Dave ---------------------------------------- http://redmine.ruby-lang.org