Ruby Runtime Libraries

is there a way to list the libraries a ruby script is loading when it
runs?

thanks…

You can use ruby -rtracer or work from within irb --tracer.

if you work from irb, using flyrb might prove handy when examining code.

Scott

On 11/30/2010 08:26 PM, Robert Huber wrote:

is there a way to list the libraries a ruby script is loading when it
runs?

Place this somewhere after the initialization:

p $"
p $LOADED_FEATURES

If you want to execute more control you could do

def trace_load
a = $".dup
r = yield
p($".dup - a)
r
end

trace_load do
require ‘your_lib’
end

Kind regards

robert