From: "H.Yamamoto" Date: 2005-04-25T11:00:44+09:00 Subject: Re: profiler.rb Schroedinbug >A ruby program with the single instruction "require 'profile'" >(or with a small program attached afterward) fails on Ruby 1.8 >and 1.9. > >c:/ruby/lib/ruby/1.8/profiler.rb:30: undefined method `[]' for >nil:NilClass (NoMethodError) Maybe, did you require "profile.rb" on irb? E:\ruby-cvs\bcc32>irb19 irb(main):001:0> require "profile" % cumulative self self total time seconds seconds calls ms/call ms/call name 1600.00 0.16 0.16 1 160.00 160.00 Profiler__.start_profile 0.00 0.16 0.00 1 0.00 0.00 IRB::Irb#signal_status 0.00 0.16 0.00 1 0.00 0.00 RubyLex#each_top_level_sta tement 0.00 0.16 0.00 1 0.00 160.00 IRB::WorkSpace#evaluate 0.00 0.16 0.00 1 0.00 0.00 IRB.start 0.00 0.16 0.00 2 0.00 0.00 Module#=== 0.00 0.16 0.00 1 0.00 0.00 IRB::Context#evaluate 0.00 0.16 0.00 1 0.00 10.00 #toplevel 0.00 0.16 0.00 1 0.00 0.00 IRB::Irb#eval_input E:/ruby-cvs/ruby/lib/profiler.rb:27: undefined method `[]' for nil:NilClass (NoM ethodError) from E:/ruby-cvs/ruby/lib/profiler.rb:5:in `start' from E:/ruby-cvs/ruby/lib/irb.rb:51:in `start' from ../ruby/bin/irb:13 I couldn't reproduce the problem outside of irb. E:\ruby-cvs\bcc32>ruby19 -rprofile -e "" % cumulative self self total time seconds seconds calls ms/call ms/call name 400.00 0.04 0.04 1 40.00 40.00 Profiler__.start_profile 0.00 0.04 0.00 1 0.00 10.00 #toplevel