Hi,
I am glad to see that ROOT has no ruby bindings so I can use ROOT inside my ruby scripts. I am trying to produce a plot with a graph but I cannot find how to use the TColor class to do
Is it supported? Is there any place where I can find some documentation for ROOT in ruby?
Thanks!
Juanpe.
See example macros in the “${ROOTSYS}/tutorials/ruby” subdirectory (note: you need to use ROOT 5, ROOT 6 has no ruby support yet).
Try something like:
ruby -rroot-config --libdir
/libRuby demo.rb
I cannot run any of the tutorials now that I have tested. It says that the library cannot be loaded:
$ ruby -r../lib/libRuby ruby/demo.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ../lib/libRuby (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
I can see a libRuby.so file but it won’t load. I compile it with the --enable-ruby and I also set the enviroment to have the RUBYLIB variable well defined:
$ echo $RUBYLIB
/Users/juanpe/root/lib:/lib:
Thanks
You need to:
cd ${ROOTSYS}/tutorials/ruby
(and maybe first copy this subdirectory to somewhere so that you will be able to write in there)
then try something like:
ruby -rroot-config --libdir
/libRuby demo.rb
or:
ruby -r${ROOTSYS}/lib/libRuby demo.rb
Hi Wile,
that is what I did, but in any case, copying your exact commands I find the same error:
$ ruby -r`root-config --libdir`/libRuby demo.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- /Users/juanpe/root/lib/libRuby (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
so it seems that I cannot read the ruby library but the env. variables seem to be fine:
$ echo $ROOTSYS
/Users/juanpe/root
$ echo $LD_LIBRARY_PATH
/lib:/Users/juanpe/root/lib:/lib:
$ echo $RUBYLIB
/Users/juanpe/root/lib:/lib:
And the libRuby.so file is there.