So, here goes… there’s plenty to say so my overview of Ruby on Rails is going to be a multi-parter. Note, this isn’t going to be a tutorial - there are plenty of those about. This is my view on what makes Rails hot and where it’s not based on my experiences as a Rails newbie. My background, for reference, is with J2EE professionally, and PHP on the side.
Firstly, a very brief introduction for those who haven’t a clue what I’m talking about. Ruby is an interpreted object-oriented programming language which, whilst nice enough, is in itself nothing special. Rails, is an open source web application framework that prides itself on productivity without sacrificing maintainability. Its sweet spot is with database driven applications which is where I came in…
I have an online entries system for orienteering events written in PHP with MySQL at the backend. Over the years it has been used for various different types of event and has been extended in every which way until the code base had become a mess calling for either a major refactor or a rewrite. So, what better excuse to give Rails a whirl? Conveniently, this coincided with a busy time at work and lots of travelling which meant I actually read Agile Web Development with Rails cover to cover before writing a line of code. This has to be definitive guide to the subject and is a good mixture of introductory and reference material.
Next step was to set up my development environment. I’m currently using Ubuntu Edge (in a VMWare image so I can take it with me when I’m on the road) so I could use apt-get to pull down Ruby and the Ruby package management system RubyGems. I then used gems to install Rails and its dependencies. And that’s it - along with your favourite editor, everything you need to get started developing with Rails downloaded an installed in ten minutes.
Starting on your first application is then trivial. The simple command rails myapp creates a directory myapp and all of the necessary subdirectories and files required for a working Rails application. One of those files is a script which can be used to run the application on Ruby’s built in web server WEBrick. And there you are, done, your first Ruby application. OK, it doesn’t actually do anything other than display the standard generated index page but three hours later I’d still be downloading Rational Application Developer!
