↓ Skip to main content

Rails Overview: Intro and Getting Started

·2 mins

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!

Related

Hosting by the slice

·2 mins
A couple of months back I was looking for somewhere to host a Ruby on Rails app (of which more in another post shortly). In the end I settled for a Virtual Private Server from US firm Slicehost (who are themselves Rails developers). For just over £10 a month I get 10GB of storage, 100GB of bandwidth and 256MB. Bargain! I’d love to use a host in the UK but I’d easily be paying twice that and getting half the spec (unless someone out there can point me at a good deal I’ve missed).

Pitter patter of tiny feet

·1 min
No - no baby yet. These tiny feet are entirely unwelcome and were heard scampering around the loft last night. I poked my head up there and shone a torch around and could only make out what appears to be a wasp nest. Fortunately that looks to be unused. No sign of any rodent activity. Now the moral dilemma - should I get an old fashioned spring-loaded mouse trap or something to keep the wee beasty alive? To be honest, I’m not worried about killing the mouse, it’s clearing up afterwards that bothers me! Browsing around, it’s interesting to read that house mice are unlikely to survive when released in to the wild anyway. I was amused by this article on an award by PETA to the inventor of a “humane mouse trap” (where “humane” means they get gassed rather than having their necks broken.)

Process Server and ESB exception handling

Another useful fact I picked up at WSTC was around retry behaviour for JMS exports. Pamela Fong and Jeff Brent have put together a very detailed developerWorks article covering all aspects of exception handling in WebSphere Process Server and WebSphere ESB. Definitely worth trying to get your head round this stuff.

2 archived comments

These comments were left on the original WordPress version of this site. Comments are now closed.

  1. Neil

    Dave,
    a minor question, why Ubuntu? I have tried Ununtu and find that compared to pure unadulaterated debian it is second best by quite a long way. It is fine if you want to play DVDs etc but otherwise pure debian is much nicer.

    cheers,
    Neil

  2. DaveAuthor

    Neil - No particular reason. I used to have Debian installed on my desktop machine at work but when IBM took up the Linux banner it wasn’t one of the blessed distros so I now have RHEL. I just happened to stumble across an Ubuntu VMWare image and thought I’d see what all of the fuss was about and haven’t stopped using yet.