Ever sit around the table with a bunch of ties and realize not one of them understands a word coming out of your mouth? I do. How did I get here?

Tuesday, December 05, 2006

Implement: Starting a Rails Project

So you got Ruby on Rails (RoR) installed on your computer - now you want to start using it. There are a couple things I do when starting a project that may come in helpful for you. They may not be for everyone - so give them a read before you implement.

One very kewl thing a RoR project can do is something called edge rails. There are various ways to make use of this idea and I like one solution that I will reveal here. Essentially edge rails embeds your rails module into the vendor/ folder of your project - you can take that a step further, using Subversion, and make the rails update separate from your project.

And though the name may be called 'edge', it does not always need to be bleeding edge, if stability is more important than features. You can checkout a specific version of rails.

# instead of the last propset, use this for v1.1.6svn propset svn:externals "rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-1-6/ vendor/rails" vendor

Thats about it really. Oh, you can do a lot of other small tweaks as well. In fact there are some great ruby tools to automate this (as well as other migration or implementation) actions.

Don't forget to commit your final changes and then do another copy to tag this level of your source.

In an earlier posting, I had shown how to install Rails to Edgy. In this article I installed RubyGems manually, circumnavigating the DEB package. Using Edge Rails you could install the rails DEB with:

sudo apt-get install rails

At that point, create your project as normal, follow these instructions to configure your installation while also using Edge Rails with subversion. This means you can use the stable version of rails as that comes with Ubuntu but then use Edge rails within your project for a newer version. If you do this, be sure to run:

ruby vendor/rails/railties/bin/rails .

We do this so that your new project is upgraded to the latest rails version. This is not safe to do if you have already started to add content to this project.