InstantRails using existing installations (tips and tricks)

| | bookmark | email | 3 comments
I've been reading a lot about Ruby on Rails, because being a committer on one of the most important Java web frameworks (WebWork) made me curious about it. But this post is not another RoR vs Java web framework post. (by the way, WebWork has already some productivity improvements and more work is on the way on the SAF2 (Struts Action Framework) side)
Today, I've had finally time to install RoR on my laptop in an attempt to see it at work. I was looking for an installer that would make things very simple, and indeed the guys on Ruby community made it available in the form of InstantRails. A zip file, containing absolutely everything you need to start playing with RoR and immediately see your toys. Excellent decission!
However, I've been a little bit intrigued by the fact that the zip file already contains a Ruby distribution (1.8.4) and also MySQL, both of which I have already installed. So I have tried to make it use the existing parts I had instead of its own copies. As advertised, RoR is about convention over configuration, so I couldn't figure out how to do this without some tricks [smile/].
The tricks are quite simple:
  • copy all RoR related gems to your default Ruby installation
  • copy all SCGI and Mongrel scripts to your default Ruby installation dir
  • delete the ruby directory in InstantRails installation and use the excellent tool junction to create a link from ruby to your Ruby installation dir
  • use mysqldump utility to dump the example dbs in InstantRails
  • create these DBs in your MySQL
  • delete the mysql directory in InstantRails installation and use again junction to create a link from mysql to your MySQL installation dir
After doing this you have an installation of InstantRails that uses your existing Ruby and respectively MySQL installation.
I am posting this because I couldn't find any hints on achieving it on InstantRails mailing list archieves and I guess there may be other people trying to do it.