我嘗試使用紅寶石教授簡要介紹一下代碼。看來工作,直到下面的線表示:未定義的方法「主題」使用紅寶石教授
require 'rubygems'
require 'ruby-prof'
result = RubyProf.start do
puts "do stuff..."
end
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT, {}) #fails here
錯誤:
[email protected]:~/code/clancms$ ruby ./memtest.rb
/home/hulkster/.rvm/gems/ruby-1.9.2-p180/gems/ruby-prof-0.10.7/lib/ruby-prof/flat_printer.rb:31:in `print_threads': undefined method `threads' for RubyProf:Module (NoMethodError)
from /home/hulkster/.rvm/gems/ruby-1.9.2-p180/gems/ruby-prof-0.10.7/lib/ruby-prof/flat_printer.rb:25:in `print'
from ./memtest.rb:8:in `<main>'
有什麼建議?