QTRuby and RVM
2011-06-19 tutorialSomehow or another, I got a wild hair and decided to try the QTRuby tutorial stuff. I haven't done much GUI development on Linux proper, so now seems like as good a time as any to try it.
Normally, this would be a piece of cake on Slackware, given that the kdebindings package includes the QT Ruby bindings by default, as pointed out by vbatts. However, there's a hiccup, in that I'm using RVM for my work with Rails development. When using Ruby 1.9.2 locally, it completely ignores the system Ruby stuff, including the QT bindings, as verified by using irb to "require 'Qt'" both as my user and as root (who is not using RVM.) It throws a fit as a user, but returns true as root.
The RVM site includes some information on using QTRuby with RVM, specifically with Ubuntu. The up-shot is, you download and build it manually, which is less than ideal to say the least. One of these years, I will get around to writing a SlackBuild for RVM, if vbatts or fred don't beat me to it. In the meantime, I've modified the instructions over at RVM slightly.
You still download and build QTRuby manually. The difference is, run cmake as "cmake -DCMAKE_INSTALL_PREFIX=$MY_RUBY_HOME" and run everything as the user you're developing as under RVM. This will automatically install everything in your RVM directory, which you own. This still clutters your system a tad, but there's no installing to /usr/local/ and no chown'ing required.
I'm sure there's a better way to do this, possibly by symlinking to the system bindings. But, this is working for me, so I'll go with it.
Comments:
Comment from JK Wood - http://www.slaxer.com
Comment: It has been pointed out that, given I use Slackware, I could just "rvm use system" and go to town. Thanks again to vbatts for the insight. That said, these instructions still hold if you're using a distro that doesn't provide the QT Ruby bindings.
2011-06-19 15:31:52