InstantRails using existing installations (tips and tricks)

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.

category: , , , ,

Advertisements

3 Comments

Filed under Uncategorized

3 responses to “InstantRails using existing installations (tips and tricks)

  1. Anonymous

    I guess I am overlooking something very simple here but I can’t create the junction. Can you post a quick sample of what you typed in the prompt to get junction to create the “junction” on the MySQL part?

    I have done:

    junction C:\InstantRails\mysql C:\Program Files\MySQL\MySQL Server 5.0

    but that doesn’t seem to work. What am I doing wrong?

  2. the_mindstorm

    I think the problem might be that the target folder path has spaces. I guess you should double quote it, as in junction mylink “C:\Program Files\”

    ./alex

    .w( the_mindstorm )p.

  3. Sameer

    I was in the same situation. These instructions helped me use existing MySQL. Now I will try the same with Apache! Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s