LoadError occurs when required libraries (shared libraries or gems, etc.) are not found. Default libraries are that of ruby 1.8.7 and of Qt 4.4; these are on the load path. But my target libraries are not.
I should set load path, by using $LD_LIBRARY_PATH. Ruby 1.9.1's library path is /opt/ruby-1.9.1/lib and Qt 4.5's library path is /opt/qtsdk-2009.01/qt/lib. Setting in bash is below:
if [ -d '/opt/ruby-1.9.1/lib' ] ; then
if [ -d '/opt/qtsdk-2009.01/qt/lib' ] ; then
For KDE user, above shell script can't set /etc/bashrc, /etc/profile, .bashrc, .profile, and so on. Because default KDE is built with default Qt, and KDE will be confused if non-default Qt is loaded. So above shell script should be hand-operated.
Then check $LD_LIBRARY_PATH.
irb(main):001:0> require 'Qt'
Let's check executable files of QtRuby.
Ruby Resource Compiler for Qt version 4.5.0
Qt User Interface Compiler version 4.5.0
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux/qtruby4.so: /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/qtruby4.so: undefined symbol: classname - /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/qtruby4.so (LoadError)
from /opt/ruby-1.9.1/bin/rbqtapi:6:in `require'
What happen in rbqtapi. show this file until line 6.
# Note: this program is part of qtruby and makes use of its internal functions.
# You should not rely on those in your own programs.
Line 1, shebang indicates ruby on the $PATH. Normally, ruby 1.9.1 executable should be added to $PATH, but I planned to rewrite shebang locally.
QtRuby 2.0.2 using Qt-4.5.0
Finally, Build succeeds!